is.js 271 B

123456
  1. // not an airtight indicator, but a good gut-check to even bother trying
  2. const { promisify } = require('util')
  3. const fs = require('fs')
  4. const stat = promisify(fs.stat)
  5. module.exports = ({ cwd = process.cwd() } = {}) =>
  6. stat(cwd + '/.git').then(() => true, () => false)