Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kenotron/glob-hasher
https://github.com/kenotron/glob-hasher
Last synced: 19 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/kenotron/glob-hasher
- Owner: kenotron
- Created: 2023-02-09T00:55:18.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-04T19:46:51.000Z (8 months ago)
- Last Synced: 2024-11-19T19:04:33.752Z (about 2 months ago)
- Language: JavaScript
- Size: 953 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
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
```js
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.