How to use node-gyp - 1 common examples

To help you get started, we’ve selected a few node-gyp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github prebuild / node-gyp-build / bin.js View on Github external
function build () {
  var args = [os.platform() === 'win32' ? 'node-gyp.cmd' : 'node-gyp', 'rebuild']

  try {
    args = [
      process.execPath,
      path.join(require.resolve('node-gyp/package.json'), '..', require('node-gyp/package.json').bin['node-gyp']),
      'rebuild'
    ]
  } catch (_) {}

  proc.spawn(args[0], args.slice(1), { stdio: 'inherit' }).on('exit', function (code) {
    if (code || !process.argv[3]) process.exit(code)
    exec(process.argv[3]).on('exit', function (code) {
      process.exit(code)
    })
  })
}

node-gyp

Node.js native addon build tool

MIT
Latest version published 5 months ago

Package Health Score

93 / 100
Full package analysis

Popular node-gyp functions