NODE-JS-RUST-FFI
A simple test on interacting between languages with JS and Rust.
How to run
Requirements
- nodejs
- rustc + cargo
Compile
First compile the source code to a .so
file.
$ cargo build --release # This flag is important, since it will generate the file that node will look for.
Install Node packages
Install the ffi-napi
module for NodeJS.
$ yarn
Node, you'll need to be inside the
node
root folder
Run the program
$ node index.js
Author
Eder Lima |