UNPKG
@npmcli/git
Version:
latest (7.0.1)
7.0.1
7.0.0
6.0.3
6.0.2
6.0.1
6.0.0
5.0.8
5.0.7
5.0.6
5.0.5
5.0.4
5.0.3
5.0.2
5.0.1
5.0.0
4.1.0
4.0.4
4.0.3
4.0.2
4.0.1
4.0.0
3.0.2
3.0.1
3.0.0
2.1.0
2.0.9
2.0.8
2.0.7
2.0.6
2.0.5
2.0.4
2.0.3
2.0.2
2.0.1
2.0.0
1.0.1
1.0.0
a util for spawning git from npm CLI contexts
github.com/npm/git
npm/git
@npmcli/git
/
lib
/
is.js
5 lines
(4 loc)
•
216 B
JavaScript
View Raw
1
2
3
4
5
// not an airtight indicator, but a good gut-check to even bother trying
const
{ stat } =
require
(
'fs/promises'
)
module
.
exports
=
(
{ cwd = process.cwd() } = {}
) =>
stat
(cwd +
'/.git'
).
then
(
() =>
true
,
() =>
false
)