glob-hasher
v1.4.2
Published
A simple glob hasher for Node.js, uses Rust for faster globbing and hashing
Downloads
42,790
Readme
glob-hasher
A library that will glob for files and return the xxhash in u64 / BigInt as a JS library. It takes advantage of napi-rs to interop with the libraries doing the heavy lifting of both globbing and hashing. xxhash-rust
, ignore
crates are used here.
API
import { hashGlob, hashGlobParallel } from "glob-hasher";
// Glob and hash with 16 threads
hashGlobParallel(["**/*.ts", "!**/node_modules/**"], {
cwd: "some/path",
concurrency: 16
});
// Glob and hash only with one core, using .gitignore to filter the glob
hashGlob(["**/*.ts"], {
cwd: "some/path",
gitignore: true
});
Releasing
Be sure to use npm version
to create a new git tag.