
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
A command line tool for easily doing prebuilds for multiple versions of node/iojs or electron on a specific platform
A command line tool for easily doing prebuilds for multiple versions of Node.js, io.js and Electron on a specific platform.
$ npm install -g prebuild
node-gyp
to use those instead of the ones installed on your system.--upload
) prebuilt binaries to GitHub.--strip
) debug information. Strip command defaults to strip
but can be overridden by the STRIP
environment variable.prebuild-install
.Building is only required for targets with different ABI versions. To build for all supported ABI versions (example from leveldown):
prebuild --all
Supported ABI versions may change over time without a new prebuild release.
Alternatively, to build for some specific versions you can do:
prebuild -t 0.10.42 -t 0.12.10 -t 4.3.0
To build against Electron headers, do:
prebuild -t 1.4.10 -r electron
See allTargets
for all available versions.
For more options run prebuild --help
. The prebuilds created are compatible with node-pre-gyp
prebuild
supports uploading prebuilds to GitHub releases. If the release doesn't exist, it will be created for you. To upload prebuilds simply add the -u <github-token>
option:
$ prebuild --all -u <github-token>
If you don't want to use the token on cli you can put it in ~/.prebuildrc
:
upload=<github-token>
Note that --upload
will only upload the targets that was built and stored in ./prebuilds
, so prebuild -u <github-token> -t 4.3.0
will only upload the binary for the 4.3.0
target.
You can use prebuild --upload-all
to upload all files from the ./prebuilds
folder.
A GitHub token is needed for two reasons:
To create a token:
Generate new token
buttonGenerate token
button, see belowThe default scopes should be fine.
$ prebuild -h
prebuild [options]
--target -t version (version to build or install for)
--runtime -r runtime (Node runtime [node or electron] to build or install for, default is node)
--all (prebuild for all known abi versions)
--upload -u [gh-token] (upload prebuilds to github)
--upload-all -u [gh-token] (upload all files from ./prebuilds folder to github)
--preinstall -i script (run this script before prebuilding)
--path -p path (make a prebuild here)
--libc (use provided libc rather than system default)
--backend (specify build backend, default is 'node-gyp')
--strip (strip debug information)
--debug (set Debug or Release configuration)
--verbose (log verbosely)
--version (print prebuild version and exit)
var prebuild = require('prebuild')
Options:
.log
(optional).preinstall
(optional).gyp
Provide a custom node-gyp
instance (optional).backend
Provide a custom node-gyp
instance via string. Alternatives are 'node-gyp'
and 'node-ninja'
(optional, defaults to 'node-gyp'
).args
Additional command line arguments to node-gyp
(optional).debug
Pass in --debug
on command line to gyp backend (optional)Example:
prebuild.build({}, version, function (err) {
// ...
})
.debug
Download or build a debug build (default: false
).arch
Processor architecture (default: process.arch
)prebuild
If you want to hack on prebuild
you need an environment to play around with. We recommend a setup similar
to the following:
prebuild
$ git clone git@github.com:<your-nick>/prebuild
$ cd prebuild && npm link && cd ..
$ git clone git@github.com:<your-nick>/some-native-module
Since you did npm link
on prebuild
it will be installed globally. Now you can go ahead and try things out.
$ cd some-native-module
$ prebuild --all --strip -u <github-token>
This command would:
some-native-module
for all supported targets and store them in ./prebuilds/
Before you commit your changes and send us a pull request, do run npm test
.
MIT
FAQs
A command line tool for easily making prebuilt binaries for multiple versions of node, electron or node-webkit on a specific platform
The npm package prebuild receives a total of 9,081 weekly downloads. As such, prebuild popularity was classified as popular.
We found that prebuild demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.