ο»Ώ#
OmniFS
High-performance filesystem discovery engine for Node.js.
Designed for build tools, search indexers, and large monorepo workflows.
omnifs is a low-level filesystem engine designed to bridge the performance gap between Node.js and native system calls. By offloading recursive traversal, glob filtering, and hashing to a multi-threaded Rust core via napi-rs, it reduces pressure on the Node.js event loop during large traversal workloads and minimizes garbage collection overhead.
- Parallel Traversal: Adaptive worker pooling to saturate available I/O bandwidth.
- Ignore Semantics: Native support for recursive
.gitignorehierarchy. - Incremental Mode: JSONL-backed indexing to skip unchanged subtrees in subsequent scans.
- Streaming API: Async Iterator interface with backpressure-aware batching.
- Integrity Pipeline: Optional
blake3hashing integrated directly into traversal.
| Capability | Path Walkers | Glob Utilities | omnifs |
|---|---|---|---|
| Rust-Powered Engine | β | β | β |
| Async Streaming API | β | β | |
| Ignore-aware Traversal | β | ||
| Incremental Rescans | β | β | β |
| Native Hashing Pipeline | β | β | β |
| Deterministic Ordering | β | β | β |
omnifs is optimized for balanced throughput, low latency streaming, and stable memory usage.
Observed ranges below were measured on a ~100,000 file dataset.
Performance varies depending on filesystem type, dataset structure, CPU, and storage medium.
- Ignore-aware Traversal: ~600β700ms total runtime.
- Latency to First Result: ~2β5ms.
- Memory Footprint: ~120β180MB peak RSS under sustained load.
- Incremental Rescan: ~80ms via metadata-based subtree skipping.
- Hashing (
blake3): ~4β6s for full-content hashing across 100k files.
omnifs ships a JS wrapper plus platform-specific native binaries selected automatically at install/runtime.
npm install omnifsNative binaries load lazily at runtime. No build step is required on supported platforms.
Some Linux CI environments skip optional native dependencies by default. If the native engine fails to load:
npm install --include=optional omnifsIf npm fails to recover optional dependencies due to lockfile state:
rm -rf node_modules package-lock.json
npm installThis resolves known npm optional-dependency edge cases in strict CI setups.
If you're using pnpm, ensure
pnpmis not configured to ignore optional dependencies.
Returns an AsyncGenerator<FileMetadata>.
import { discover } from "omnifs";
for await (const file of discover("./src")) {
console.log(`${file.path} β ${file.size} bytes`);
}import { discoverBatched } from "omnifs";
for await (const batch of discoverBatched(".", { batchSize: 512 })) {
await Promise.all(batch.map(file => process(file)));
}omnifs works across modern Node.js module systems.
import { discover } from "omnifs";const { discover } = require("omnifs");import type { FileMetadata } from "omnifs";Each emitted entry contains:
path: stringsize: numbermtimeMs: numberidentity: stringhash?: string | null
| Option | Type | Default | Behavior |
|---|---|---|---|
patterns |
string[] |
[] |
Glob include patterns. |
respectGitignore |
boolean |
true |
Honors .gitignore rules. |
incremental |
boolean |
false |
Enables change detection. |
hash |
"blake3" | false |
false |
Enables hashing pipeline. |
mode |
"auto" | "crawl" | "glob" | "ignore" |
"auto" |
Traversal strategy. |
fastPath |
"auto" | "glob" | "none" |
"auto" |
Enables glob fast-path. |
fingerprinting |
boolean |
false* |
Skip unchanged subtrees. |
forceHash |
boolean |
false |
Hash unchanged files in incremental mode. |
deterministic |
boolean |
false |
Stable ordering. |
batchSize |
number |
256 |
Adaptive batch size. |
threads |
number |
CPUs |
Worker count. |
signal |
AbortSignal |
undefined |
Cancellation support. |
autoβ Default optimized path.crawlβ Full traversal.globβ Pattern-focused mode.ignoreβ Exclusion-focused traversal.
- Incremental + No Hash β Metadata comparison only.
- Incremental + blake3 β Hash changed files.
- Standard + blake3 β Hash all emitted files.
If you only need simple glob expansion without metadata or streaming guarantees, lightweight JS glob libraries may be faster.
- Node.js
>=20 - ESM / CommonJS / TypeScript supported
- Linux: x64/arm64 (gnu + musl)
- macOS: x64/arm64
- Windows: x64/arm64
MIT β Copyright Β© 2026
omnifs β’ 2026