Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
node-ffi-rs
Advanced tools
A module written in Rust and N-APi provides interface (FFI) features for Node.js
A module written in Rust and N-APi provides interface (FFI) features for Node.js
ffi-rs is a module written in Rust and N-API that provides FFI (Foreign Function Interface) features for Node.js. It allows developers to call functions written in other languages such as C++, C, and Rust directly from JavaScript without writing any C++ code.
This module aims to provide similar functionality to the node-ffi module, but with a completely rewritten underlying codebase. The node-ffi module has been unmaintained for several years and is no longer usable, which is why ffi-rs was developed.
Currently, ffi-rs only supports two types of parameters and return values: strings and numbers. However, support for more types will be added in the future based on actual usage scenarios.
Here is an example of how to use ffi-rs:
export const enum RetType {
String = 0,
I32 = 1
}
export const enum ParamsType {
String = 0,
I32 = 1
}
const p = require('ffi-rs')
const r = p.load({
library: "/usr/libsum.so", // path to the dynamic library file
funcName: 'sum', // the name of the function to call
retType: 1, // the return value type
paramsType: [1, 1], // the parameter types
paramsValue: [-99, 2] // the actual parameter values
})
console.log('result', r)
FAQs
A module written in Rust and N-API provides interface (FFI) features for Node.js
The npm package node-ffi-rs receives a total of 92 weekly downloads. As such, node-ffi-rs popularity was classified as not popular.
We found that node-ffi-rs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.