Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sonicdoe/bindung
Helps you require your native Node.js addon.
https://github.com/sonicdoe/bindung
bindings c c-plus-plus es2015 javascript nodejs require semver
Last synced: about 1 month ago
JSON representation
Helps you require your native Node.js addon.
- Host: GitHub
- URL: https://github.com/sonicdoe/bindung
- Owner: sonicdoe
- License: isc
- Created: 2017-01-01T16:52:20.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-01-01T18:10:27.000Z (about 8 years ago)
- Last Synced: 2024-11-19T15:02:40.044Z (about 2 months ago)
- Topics: bindings, c, c-plus-plus, es2015, javascript, nodejs, require, semver
- Language: JavaScript
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# bindung
[![Node.js package](https://img.shields.io/npm/v/bindung.svg)](https://www.npmjs.com/package/bindung)
[![Build status](https://img.shields.io/travis/sonicdoe/bindung.svg)](https://travis-ci.org/sonicdoe/bindung)> Helps you require your native Node.js addon.
`bindung` is a simpler and more modern alternative to
[`bindings`](https://github.com/TooTallNate/node-bindings).
It removes support for legacy paths, requires Node.js v4 or later, and
basically uses a simple `try…catch` statement [as explained in the Node.js documentation](https://nodejs.org/dist/latest-v6.x/docs/api/addons.html#addons_building).## Installation
```sh
$ npm install bindung --save
```## Usage
Pass the `target_name`, as defined in your `binding.gyp`, to `bindung`.
```js
const addon = require('bindung')('addon')
```## Differences to bindings
- Only tries `Release` and `Debug` build paths
([as opposed to `bindings`](https://github.com/TooTallNate/node-bindings/blob/v1.2.1/bindings.js#L18-L34))
- Looks for `binding.gyp` instead of `package.json`
(therefore it works without `package.json` being present)
- Always appends `.node`
([as opposed to `bindings`](https://github.com/TooTallNate/node-bindings/blob/v1.2.1/bindings.js#L58-L61)),
which means that you should not append `.node` yourself
- Requires Node.js v4 or later## Changelog
This project follows [Semantic Versioning 2](http://semver.org/).
- v1.0.0 (2017-01-01): Initial release
## License
`bindung` is licensed under the ISC license.
See [`LICENSE`](./LICENSE) for the full license.