index.js 346 B

1234567891011121314
  1. const util = require('util')
  2. const fs = require('fs')
  3. const {stat} = fs.promises || { stat: util.promisify(fs.stat) };
  4. async function isNodeGypPackage(path) {
  5. return await stat(`${path}/binding.gyp`)
  6. .then(st => st.isFile())
  7. .catch(() => false)
  8. }
  9. module.exports = {
  10. isNodeGypPackage,
  11. defaultGypInstallScript: 'node-gyp rebuild'
  12. }