Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 2nd, 2012  |  syntax: None  |  size: 0.32 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. var FFI = require("node-ffi");
  2.  
  3. var libm = new FFI.Library("libm", { "ceil": [ "double", [ "double" ] ] });
  4. console.log(libm.ceil(1.5)); // 2
  5.  
  6. // You can also access just functions in the current process by passing a null
  7. var current = new FFI.Library(null, { "atoi": [ "int32", [ "string" ] ] });
  8. current.atoi("1234"); // 1234