Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thlorenz/nad-bindings
Generic Node.js bindings, uses node-bindings for .node modules and process.binding when run as part of Node.js
https://github.com/thlorenz/nad-bindings
Last synced: 2 months ago
JSON representation
Generic Node.js bindings, uses node-bindings for .node modules and process.binding when run as part of Node.js
- Host: GitHub
- URL: https://github.com/thlorenz/nad-bindings
- Owner: thlorenz
- License: mit
- Created: 2014-09-03T15:10:04.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-04-23T16:12:28.000Z (over 9 years ago)
- Last Synced: 2024-10-18T00:12:43.712Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 189 KB
- Stars: 4
- Watchers: 5
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nad-bindings
Generic Node.js bindings, uses @TooTallNate's bindings for `.node` modules and `process.binding` when run as part of Node.js.
Use it for projects generated with [nad](https://github.com/thlorenz/nad).
```js
var leveldown = require('nad-bindings')('leveldown.node').leveldown
```## Installation
npm install nad-bindings
## API
resolveBinding(name) → {Object}Convenience function to consistently resolve a module binding for two cases:
- a) module is run as addon and the
bindings
module is used to resolve the module- b) module is currently being debugged and directly executed inside a node process and therefore is resolved via
process.binding
Parameters:
Name
Type
Description
name
string
full name of the module
Returns:
the binding object of the native module
Type
Object*generated with [docme](https://github.com/thlorenz/docme)*
## Implementation
Looks for `DYLD_LIBRARY_PATH` environment variable to determine whether it is run via Xcode.
Any improvements on that are welcome.## License
MIT