UNPKG

@npmcli/git

Version:

a util for spawning git from npm CLI contexts

5 lines (4 loc) 216 B
// 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)