Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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


Source:



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