From 8ee70f9031a421e05b3ac5d5fb91e2d52024f870 Mon Sep 17 00:00:00 2001 From: Vincent Weevers Date: Sat, 27 Nov 2021 17:33:06 +0100 Subject: [PATCH] Clarify usage in README Closes #133, closes #134. --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index 2d59ee7..6e7d94e 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,18 @@ Use [`prebuild`](https://github.com/prebuild/prebuild) to create and upload preb } ``` +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: + +```json +{ + "scripts": { + "install": "prebuild-install -r napi || node-gyp rebuild" + } +} +``` + ### Help ``` @@ -134,6 +146,14 @@ All prebuilt binaries are cached to minimize traffic. So first `prebuild-install - `${APP_DATA}/npm-cache/_prebuilds` - `${HOME}/.npm/_prebuilds` +## Install + +With [npm](https://npmjs.org) do: + +``` +npm install prebuild-install +``` + ## License [MIT](./LICENSE)