### Install prebuildify Globally Source: https://github.com/prebuild/prebuildify/blob/master/README.md Installs the prebuildify command-line tool globally using npm. ```sh npm install -g prebuildify ``` -------------------------------- ### Install node-gyp-build Source: https://github.com/prebuild/prebuildify/blob/master/README.md Installs the node-gyp-build package as a dependency for your native module. ```sh # first install node-gyp-build npm install --save node-gyp-build ``` -------------------------------- ### Configure npm Install Script Source: https://github.com/prebuild/prebuildify/blob/master/README.md Adds the 'node-gyp-build' script to your package.json, which will be executed during npm installation. ```json { "name": "your-native-module", "scripts": { "install": "node-gyp-build" } } ``` -------------------------------- ### Build Prebuilds for All Versions Source: https://github.com/prebuild/prebuildify/blob/master/README.md Navigates to a native module directory and builds prebuilt binaries for all supported Node.js and Electron versions, stripping symbols. The prebuilds are stored in the './prebuilds' directory. ```sh # go to your native module cd your-native-module # build for all electron/node binary versions and strip out symbols prebuildify --all --strip # the prebuilds will be stored in ./prebuilds ls prebuilds ``` -------------------------------- ### Build Prebuilds for Node-API Source: https://github.com/prebuild/prebuildify/blob/master/README.md Builds prebuilt binaries specifically for modules using Node-API (formerly N-API). ```sh # prebuild for node-api prebuildify --napi ``` -------------------------------- ### Load Native Binding with node-gyp-build Source: https://github.com/prebuild/prebuildify/blob/master/README.md Loads the native binding using node-gyp-build, which automatically selects a precompiled binary if available or falls back to recompiling. ```js // Will load a compiled build if present or a prebuild. // If no build if found it will throw an exception var binding = require('node-gyp-build')(__dirname) module.exports = binding ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.