Gathering detailed insights and metrics for prebuild-install
Gathering detailed insights and metrics for prebuild-install
Gathering detailed insights and metrics for prebuild-install
Gathering detailed insights and metrics for prebuild-install
@mmomtchev/prebuild-install
prebuild-install modified for hadron
node-gyp-build
Build tool and bindings loader for node-gyp that supports prebuilds
node-gyp-build-optional-packages
Build tool and bindings loader for node-gyp that supports prebuilds
@expo/prebuild-config
Get the prebuild config
npm install prebuild-install
88.4
Supply Chain
98.1
Quality
81.7
Maintenance
100
Vulnerability
99.3
License
Module System
Unable to determine the module system for this package.
Min. Node Version
Typescript Support
Node Version
NPM Version
103 Stars
226 Commits
75 Forks
9 Watching
2 Branches
42 Contributors
Updated on 11 Nov 2024
Minified
Minified + Gzipped
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-5.8%
1,114,331
Compared to previous day
Last week
2%
6,482,404
Compared to previous week
Last month
7.4%
27,370,727
Compared to previous month
Last year
29.3%
306,433,358
Compared to previous year
A command line tool to easily install prebuilt binaries for multiple versions of Node.js & Electron on a specific platform. By default it downloads prebuilt binaries from a GitHub release.
Instead of prebuild
paired with prebuild-install
, we recommend prebuildify
paired with node-gyp-build
.
With prebuildify
, all prebuilt binaries are shipped inside the package that is published to npm, which means there's no need for a separate download step like you find in prebuild
. The irony of this approach is that it is faster to download all prebuilt binaries for every platform when they are bundled than it is to download a single prebuilt binary as an install script.
Upsides:
node-gyp-build
runtime dependency is dependency-free and will remain so out of principle, because introducing dependencies would negate the shorter install time.Downsides:
npm publish
must be done after compiling and fetching prebuilt binaries (typically in CI).Use prebuild
to create and upload prebuilt binaries. Then change your package.json install script to:
1{ 2 "scripts": { 3 "install": "prebuild-install || node-gyp rebuild" 4 } 5}
When a consumer then installs your package with npm thus triggering the above install script, prebuild-install
will download a suitable prebuilt binary, or exit with a non-zero exit code if there is none, which triggers node-gyp rebuild
in order to build from source.
Options (see below) can be passed to prebuild-install
like so:
1{ 2 "scripts": { 3 "install": "prebuild-install -r napi || node-gyp rebuild" 4 } 5}
prebuild-install [options]
--download -d [url] (download prebuilds, no url means github)
--target -t version (version to install for)
--runtime -r runtime (Node runtime [node, napi or electron] to build or install for, default is node)
--path -p path (make a prebuild-install here)
--token -T gh-token (github token for private repos)
--arch arch (target CPU architecture, see Node OS module docs, default is current arch)
--platform platform (target platform, see Node OS module docs, default is current platform)
--tag-prefix <prefix> (github tag prefix, default is "v")
--build-from-source (skip prebuild download)
--verbose (log verbosely)
--libc (use provided libc rather than system default)
--debug (set Debug or Release configuration)
--version (print prebuild-install version and exit)
When prebuild-install
is run via an npm
script, options --build-from-source
, --debug
, --download
, --target
, --runtime
, --arch
--platform
and --libc
may be passed through via arguments given to the npm
command.
Alternatively you can set environment variables npm_config_build_from_source=true
, npm_config_platform
, npm_config_arch
, npm_config_target
npm_config_runtime
and npm_config_libc
.
On non-glibc Linux platforms, the Libc name is appended to platform name. For example, musl-based environments are called linuxmusl
. If --libc=glibc
is passed as option, glibc is discarded and platform is called as just linux
. This can be used for example to build cross-platform packages on Alpine Linux.
prebuild-install
supports downloading prebuilds from private GitHub repositories using the -T <github-token>
:
$ prebuild-install -T <github-token>
If you don't want to use the token on cli you can put it in ~/.prebuild-installrc
:
token=<github-token>
Alternatively you can specify it in the prebuild-install_token
environment variable.
Note that using a GitHub token uses the API to resolve the correct release meaning that you are subject to the (GitHub Rate Limit).
To create a token:
Generate new token
buttonGenerate token
button, see belowThe default scopes should be fine.
The end user can override binary download location through environment variables in their .npmrc file.
The variable needs to meet the mask % your package name %_binary_host
or % your package name %_binary_host_mirror
. For example:
leveldown_binary_host=http://overriden-host.com/overriden-path
Note that the package version subpath and file name will still be appended.
So if you are installing leveldown@1.2.3
the resulting url will be:
http://overriden-host.com/overriden-path/v1.2.3/leveldown-v1.2.3-node-v57-win32-x64.tar.gz
If you want to use prebuilds from your local filesystem, you can use the % your package name %_local_prebuilds
.npmrc variable to set a path to the folder containing prebuilds. For example:
leveldown_local_prebuilds=/path/to/prebuilds
This option will look directly in that folder for bundles created with prebuild
, for example:
/path/to/prebuilds/leveldown-v1.2.3-node-v57-win32-x64.tar.gz
Non-absolute paths resolve relative to the directory of the package invoking prebuild-install, e.g. for nested dependencies.
All prebuilt binaries are cached to minimize traffic. So first prebuild-install
picks binaries from the cache and if no binary could be found, it will be downloaded. Depending on the environment, the cache folder is determined in the following order:
${npm_config_cache}/_prebuilds
${APP_DATA}/npm-cache/_prebuilds
${HOME}/.npm/_prebuilds
With npm do:
npm install prebuild-install
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 12/30 approved changesets -- score normalized to 4
Reason
0 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More