A simple test on interacting between languages with JS and Rust.
- nodejs
- rustc + cargo
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 the ffi-napi
module for NodeJS.
$ yarn
Node, you'll need to be inside the
node
root folder
$ node index.js
![]() |
---|
Eder Lima |