New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

node-ffi

Package Overview
Dependencies
Maintainers
3
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-ffi - npm Package Compare versions

Comparing version 0.5.0 to 0.5.1-1

binding.gyp

3

lib/ffi.js
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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc