How to use the napi-build-utils.getBestNapiBuildVersion function in napi-build-utils

To help you get started, we’ve selected a few napi-build-utils 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 / prebuild-install / rc.js View on Github external
arch: 'a',
      path: 'p',
      version: 'v',
      download: 'd',
      'build-from-source': 'compile',
      compile: 'c',
      token: 'T'
    }
  }))

  if (rc.path === true) {
    delete rc.path
  }

  if (napi.isNapiRuntime(rc.runtime) && rc.target === process.versions.node) {
    rc.target = napi.getBestNapiBuildVersion()
  }

  rc.abi = napi.isNapiRuntime(rc.runtime) ? rc.target : getAbi(rc.target, rc.runtime)

  return rc
}
github prebuild / prebuild / rc.js View on Github external
prepack: 'c'
  },
  string: [
    'target'
  ]
}))

if (rc.path === true) {
  delete rc.path
}

if (napi.isNapiRuntime(rc.runtime) && rc.target === process.versions.node) {
  if (rc.all === true) {
    rc.target = napi.getNapiBuildVersions()
  } else {
    rc.target = napi.getBestNapiBuildVersion()
  }
}

if (rc.target) {
  var arr = [].concat(rc.target)
  rc.prebuild = []
  for (var k = 0, len = arr.length; k < len; k++) {
    if (!napi.isNapiRuntime(rc.runtime) || napi.isSupportedVersion(arr[k])) {
      rc.prebuild.push({
        runtime: rc.runtime,
        target: arr[k]
      })
    }
  }
}

napi-build-utils

A set of utilities to assist developers of tools that build N-API native add-ons

MIT
Latest version published 5 years ago

Package Health Score

65 / 100
Full package analysis