npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@shiftkey/prebuild-install

v6.0.1-pre2

Published

A command line tool to easily install prebuilt binaries for multiple version of node/iojs on a specific platform

Downloads

91

Readme

prebuild-install

A command line tool to easily install prebuilt binaries for multiple version of node/iojs on a specific platform.

npm Node version Build Status Build status david js-standard-style

prebuild-install supports installing prebuilt binaries from GitHub by default.

Usage

Change your package.json install script to:

{
  "scripts": {
    "install": "prebuild-install || node-gyp rebuild"
  }
}

Requirements

You need to provide prebuilds made by prebuild.

Help

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 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

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).

Create GitHub Token

To create a token:

  • Go to this page
  • Click the Generate new token button
  • Give the token a name and click the Generate token button, see below

prebuild-token

The default scopes should be fine.

Custom binaries

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 [email protected] the resulting url will be:

http://overriden-host.com/overriden-path/v1.2.3/leveldown-v1.2.3-node-v57-win32-x64.tar.gz

Cache

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

License

MIT