Home

Awesome

Walk thougn the Given Dir by Rust crate(readir)

Why

Use

const files = require('get-node-modules-rust').find('./');

Demo

npm run start

see Result

[ './node_modules' ]
cost time: 0.043 s

Build

cargo build --release

cp dylib into the dir named in package.json and index.js

cp target/release/libfind_files.dylib ./rust-dylib
var lib = ffi.Library(path.join(__dirname, './rust-dylib/libget_dir'), {
  get_dir: ['char *', ['string']],
  free_memory: ['void', ['char *']]
});

Use by