Comparing version 0.5.0 to 0.5.1-1
var ffi = module.exports | ||
ffi.Bindings = require('./bindings') | ||
ffi.Bindings = require('bindings')('ffi_bindings.node') | ||
@@ -34,2 +34,3 @@ ffi.VERSION = '0.5.0' | ||
, 'sunos': '.so' | ||
, 'solaris':'.so' | ||
, 'darwin': '.dylib' | ||
@@ -36,0 +37,0 @@ , 'mac': '.dylib' |
@@ -10,4 +10,8 @@ var ffi = require('./ffi') | ||
function Library (libfile, funcs) { | ||
if (libfile && libfile.indexOf(EXT) === -1) { | ||
libfile += EXT | ||
} | ||
var lib = {} | ||
, dl = new ffi.DynamicLibrary(libfile ? libfile + EXT : null, RTLD_NOW) | ||
, dl = new ffi.DynamicLibrary(libfile || null, RTLD_NOW) | ||
@@ -14,0 +18,0 @@ if (funcs) { |
{ "name": "node-ffi" | ||
, "version": "0.5.0" | ||
, "version": "0.5.1-1" | ||
, "author": "Rick Branson" | ||
@@ -11,8 +11,11 @@ , "contributors": [ | ||
, "main": "./lib/ffi" | ||
, "dependencies": { | ||
"bindings": "*" | ||
} | ||
, "devDependencies": { | ||
"expect.js": "*" | ||
, "mocha": "*" | ||
, "mocha": ">= 0.10.x" | ||
} | ||
, "scripts": { | ||
"test": "node --expose-gc ./node_modules/mocha/bin/_mocha" | ||
"test": "mocha -gc --reporter spec" | ||
} | ||
@@ -19,0 +22,0 @@ , "repository": { |
node-ffi | ||
======== | ||
### Node.js Foreign Function Interface | ||
### Node.js Foreign Function Interface [![Build Status](https://secure.travis-ci.org/rbranson/node-ffi.png)](http://travis-ci.org/rbranson/node-ffi) | ||
@@ -39,13 +39,23 @@ `node-ffi` is a Node.js addon for loading and calling dynamic libraries using pure JavaScript. It can be used to create bindings to native libraries without writing any C++ code. | ||
# SOURCE INSTALL | ||
# SOURCE INSTALL / MANUAL COMPILATION | ||
To compile from source it's easiest to use | ||
[`node-gyp`](https://github.com/TooTallNate/node-gyp): | ||
``` bash | ||
$ npm install -g node-gyp | ||
``` | ||
Now you can compile `node-ffi`: | ||
``` bash | ||
$ git clone git://github.com/rbranson/node-ffi.git | ||
$ cd node-ffi | ||
$ "$NODE_SOURCE/tools/gyp_addon" -f make | ||
$ make BUILDTYPE=Release | ||
$ pushd deps/libffi | ||
$ ./configure --enable-static --disable-shared && make | ||
$ popd | ||
$ node-gyp configure | ||
$ node-gyp build | ||
``` | ||
Note that the `NODE_SOURCE` variable needs to be set to the root dir of the node source tree. | ||
# TYPES | ||
@@ -91,2 +101,3 @@ | ||
See LICENSE file. | ||
MIT License. See the `LICENSE` file. | ||
@@ -37,2 +37,14 @@ | ||
it('should accept a lib name with file extension', function() { | ||
var lib = process.platform == 'win32' | ||
? 'msvcrt.dll' | ||
: 'libm' + ffi.PLATFORM_LIBRARY_EXTENSIONS[process.platform] | ||
var libm = new Library(lib, { | ||
'ceil': [ 'double', ['double'] ] | ||
}) | ||
var test = libm.ceil instanceof Function | ||
expect(test).to.be(true) | ||
expect(libm.ceil(100.9)).to.equal(101) | ||
}) | ||
it('should throw when an invalid function name is used', function () { | ||
@@ -39,0 +51,0 @@ expect(function () { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Wildcard dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
Copyleft License
License(Experimental) Copyleft license information was found.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 4 instances in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
7603195
786
102
2
1
7
60
2268
2
9
+ Addedbindings@*
+ Addedbindings@1.5.0(transitive)
+ Addedfile-uri-to-path@1.0.0(transitive)