mirror of
https://github.com/nodejs/node.git
synced 2025-05-15 19:48:12 +00:00

PR-URL: https://github.com/nodejs/node/pull/37496 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Beth Griggs <bgriggs@redhat.com>
15 lines
346 B
JavaScript
15 lines
346 B
JavaScript
const util = require('util')
|
|
const fs = require('fs')
|
|
const {stat} = fs.promises || { stat: util.promisify(fs.stat) };
|
|
|
|
async function isNodeGypPackage(path) {
|
|
return await stat(`${path}/binding.gyp`)
|
|
.then(st => st.isFile())
|
|
.catch(() => false)
|
|
}
|
|
|
|
module.exports = {
|
|
isNodeGypPackage,
|
|
defaultGypInstallScript: 'node-gyp rebuild'
|
|
}
|