nad-bindings

0.3.0 • Public • Published

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.

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

Implementation

Looks for DYLD_LIBRARY_PATH environment variable to determine whether it is run via Xcode. Any improvements on that are welcome.

License

MIT

Package Sidebar

Install

npm i nad-bindings

Weekly Downloads

0

Version

0.3.0

License

MIT

Last publish

Collaborators

  • thlorenz