Coder Social home page Coder Social logo

node-gyp-build's Introduction

node-gyp-build

Build tool and bindings loader for node-gyp that supports prebuilds.

npm install node-gyp-build

Build Status

Use together with prebuildify to easily support prebuilds for your native modules.

Usage

Note. Prebuild names have changed in prebuildify@3 and node-gyp-build@4. Please see the documentation below.

node-gyp-build works similar to node-gyp build except that it will check if a build or prebuild is present before rebuilding your project.

It's main intended use is as an npm install script and bindings loader for native modules that bundle prebuilds using prebuildify.

First add node-gyp-build as an install script to your native project

{
  ...
  "scripts": {
    "install": "node-gyp-build"
  }
}

Then in your index.js, instead of using the bindings module use node-gyp-build to load your binding.

var binding = require('node-gyp-build')(__dirname)

If you do these two things and bundle prebuilds with prebuildify your native module will work for most platforms without having to compile on install time AND will work in both node and electron without the need to recompile between usage.

Users can override node-gyp-build and force compiling by doing npm install --build-from-source.

Prebuilds will be attempted loaded from MODULE_PATH/prebuilds/... and then next EXEC_PATH/prebuilds/... (the latter allowing use with zeit/pkg)

Supported prebuild names

If so desired you can bundle more specific flavors, for example musl builds to support Alpine, or targeting a numbered ARM architecture version.

These prebuilds can be bundled in addition to generic prebuilds; node-gyp-build will try to find the most specific flavor first. Prebuild filenames are composed of tags. The runtime tag takes precedence, as does an abi tag over napi. For more details on tags, please see prebuildify.

Values for the libc and armv tags are auto-detected but can be overridden through the LIBC and ARM_VERSION environment variables, respectively.

License

MIT

node-gyp-build's People

Contributors

mafintosh avatar vweevers avatar ralphtheninja avatar fanatid avatar greenkeeper[bot] avatar emilbayes avatar juliangruber avatar simon-laux avatar 0xh0b0 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.