Socket
Socket
Sign inDemoInstall

prebuild-install

Package Overview
Dependencies
Maintainers
5
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prebuild-install - npm Package Compare versions

Comparing version 6.1.2 to 6.1.3

6

asset.js
var get = require('simple-get')
var util = require('./util')
var proxy = require('./proxy')
var noop = Object.assign({
http: function () {},
silly: function () {}
}, require('noop-logger'))

@@ -12,3 +8,3 @@ function findAssetId (opts, cb) {

var apiUrl = util.getApiUrl(opts)
var log = opts.log || noop
var log = opts.log || util.noopLogger

@@ -15,0 +11,0 @@ log.http('request', 'GET ' + apiUrl)

9

CHANGELOG.md
# Changelog
## [6.1.3] - 2021-06-03
### Changed
- Inline no longer maintained `noop-logger` ([#155](https://github.com/prebuild/prebuild-install/issues/155)) ([`e08d75a`](https://github.com/prebuild/prebuild-install/commit/e08d75a)) (Alexandru Dima)
- Point users towards `prebuildify` in README ([#150](https://github.com/prebuild/prebuild-install/issues/150)) ([`5ee1a2f`](https://github.com/prebuild/prebuild-install/commit/5ee1a2f)) (Vincent Weevers)
## [6.1.2] - 2021-04-24

@@ -52,2 +59,4 @@

[6.1.3]: https://github.com/prebuild/prebuild-install/compare/v6.1.2...v6.1.3
[6.1.2]: https://github.com/prebuild/prebuild-install/compare/v6.1.1...v6.1.2

@@ -54,0 +63,0 @@

@@ -6,6 +6,2 @@ var path = require('path')

var tfs = require('tar-fs')
var noop = Object.assign({
http: function () {},
silly: function () {}
}, require('noop-logger'))
var zlib = require('zlib')

@@ -21,3 +17,3 @@ var util = require('./util')

var tempFile = util.tempFile(cachedPrebuild)
var log = opts.log || noop
var log = opts.log || util.noopLogger

@@ -24,0 +20,0 @@ if (opts.nolocal) return download()

{
"name": "prebuild-install",
"version": "6.1.2",
"version": "6.1.3",
"description": "A command line tool to easily install prebuilt binaries for multiple version of node/iojs on a specific platform",

@@ -30,3 +30,2 @@ "scripts": {

"node-abi": "^2.21.0",
"noop-logger": "^0.1.1",
"npmlog": "^4.0.1",

@@ -33,0 +32,0 @@ "pump": "^3.0.0",

var url = require('url')
var tunnel = require('tunnel-agent')
var noop = Object.assign({
http: function () {},
silly: function () {}
}, require('noop-logger'))
var util = require('./util')
function applyProxy (reqOpts, opts) {
var log = opts.log || noop
var log = opts.log || util.noopLogger

@@ -11,0 +8,0 @@ var proxy = opts['https-proxy'] || opts.proxy

# prebuild-install
> A command line tool to easily install prebuilt binaries for multiple version of node/iojs on a specific platform.
> **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.

@@ -11,7 +12,24 @@ [![npm](https://img.shields.io/npm/v/prebuild-install.svg)](https://www.npmjs.com/package/prebuild-install)

`prebuild-install` supports installing prebuilt binaries from GitHub by default.
## Note
**Instead of [`prebuild`](https://github.com/prebuild/prebuild) paired with [`prebuild-install`](https://github.com/prebuild/prebuild-install), we recommend [`prebuildify`](https://github.com/prebuild/prebuildify) paired with [`node-gyp-build`](https://github.com/prebuild/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:
1. No extra download step, making it more reliable and faster to install.
2. Supports changing runtime versions locally and using the same install between Node.js and Electron. Reinstalling or rebuilding is not necessary, as all prebuilt binaries are in the npm tarball and the correct one is simply picked on runtime.
3. The `node-gyp-build` runtime dependency is dependency-free and will remain so out of principle, because introducing dependencies would negate the shorter install time.
4. Prebuilt binaries work even if npm install scripts are disabled.
5. The npm package checksum covers prebuilt binaries too.
Downsides:
1. The installed npm package is larger on disk. Using [Node-API](https://nodejs.org/api/n-api.html) alleviates this because Node-API binaries are runtime-agnostic and forward-compatible.
2. Publishing is mildly more complicated, because `npm publish` must be done after compiling and fetching prebuilt binaries (typically in CI).
## Usage
Change your package.json install script to:
Use [`prebuild`](https://github.com/prebuild/prebuild) to create and upload prebuilt binaries. Then change your package.json install script to:

@@ -26,6 +44,2 @@ ```json

### Requirements
You need to provide prebuilds made by [`prebuild`](https://github.com/prebuild/prebuild).
### Help

@@ -51,6 +65,6 @@

When `prebuild-install` is run via an `npm` script, options
`--build-from-source`, `--debug`, `--download`, `--target`, `--runtime`, `--arch` and `--platform` 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` and `npm_config_runtime`.
When `prebuild-install` is run via an `npm` script, options `--build-from-source`, `--debug`, `--download`, `--target`, `--runtime`, `--arch` and `--platform` 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` and `npm_config_runtime`.
### Private Repositories

@@ -57,0 +71,0 @@

@@ -118,2 +118,17 @@ var path = require('path')

var noopLogger = {
http: function () {},
silly: function () {},
debug: function () {},
info: function () {},
warn: function () {},
error: function () {},
critical: function () {},
alert: function () {},
emergency: function () {},
notice: function () {},
verbose: function () {},
fatal: function () {}
}
exports.getDownloadUrl = getDownloadUrl

@@ -129,1 +144,2 @@ exports.getApiUrl = getApiUrl

exports.packageOrigin = packageOrigin
exports.noopLogger = noopLogger
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc