You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+19-3Lines changed: 19 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,11 +6,26 @@ All notable changes to Rush-FS are documented here. The format is based on [Keep
6
6
7
7
- (Add new changes here before each release.)
8
8
9
-
## [0.0.5] - (release date TBD)
9
+
## [0.1.0] - (release date TBD)
10
+
11
+
**This release is in beta.** API and behavior may change before 0.1.0 stable. Feedback and issues are welcome.
12
+
13
+
### Changed
14
+
15
+
-**Package name:** The main npm package is now **`@rush-fs/core`** (scoped). Install with `pnpm add @rush-fs/core` or `npm i @rush-fs/core`, and import with `import { readdir, readFile, ... } from '@rush-fs/core'`.
16
+
-**Migration from `rush-fs`:** If you were using the old unscoped package `rush-fs`, replace it with `@rush-fs/core` in `package.json` and in all imports. The API is unchanged; only the package name and version differ. The old `rush-fs` package may be deprecated on npm in a separate step; prefer `@rush-fs/core` for new installs.
17
+
-**glob:**`gitIgnore` option now defaults to **`false`** to align with Node.js `fs.globSync` (no .gitignore filtering by default).
18
+
19
+
### Fixed
20
+
21
+
-**glob:** Patterns with a path prefix (e.g. `.dir/**/*.txt` or `src/**/*.ts`) now work when used without an explicit `cwd`; the prefix is used as the search root, matching Node.js behavior.
22
+
-**glob:** Recursive pattern `**/*.ext` with `cwd` now correctly recurses into subdirectories.
23
+
24
+
## [0.0.5]
10
25
11
26
- Re-publish with `optionalDependencies` correctly injected after `napi prepublish`, so `pnpm i rush-fs` / `npm i rush-fs` auto-installs the platform native binding. No API or behavior changes from 0.0.4.
12
27
13
-
## [0.0.4] - (release date TBD)
28
+
## [0.0.4]
14
29
15
30
### Fixed
16
31
@@ -27,7 +42,8 @@ All notable changes to Rush-FS are documented here. The format is based on [Keep
When you install `rush-fs`, the package manager should automatically install the **platform-specific native binding** for your OS/arch via `optionalDependencies` (e.g. `@rush-fs/rush-fs-darwin-arm64` on macOS ARM). If the native binding is missing and you see "Cannot find native binding", try:
29
+
When you install `@rush-fs/core`, the package manager should automatically install the **platform-specific native binding** for your OS/arch via `optionalDependencies` (e.g. `@rush-fs/rush-fs-darwin-arm64` on macOS ARM). If the native binding is missing and you see "Cannot find native binding", try:
29
30
30
31
1. Remove `node_modules` and the lockfile (`package-lock.json` or `pnpm-lock.yaml`), then run `pnpm install` (or `npm i`) again.
31
32
2. Or install the platform package explicitly:
@@ -34,10 +35,12 @@ When you install `rush-fs`, the package manager should automatically install the
|`cp` 500-file flat dir (4 threads) | 86.45 ms | 32.88 ms |**2.6x**|
87
+
|`cp` tree dir ~363 nodes (4 threads) | 108.73 ms | 46.88 ms |**2.3x**|
88
+
|`glob` large tree (`node_modules/**/*.json`, ~30k entries) vs fast-glob | 303 ms | 30 ms |**~10x**|
87
89
88
90
### On Par with Node.js
89
91
90
-
Single-file operations have a ~0.3 µs napi bridge overhead, making them roughly equivalent:
92
+
Single-file operations have a ~0.3 µs napi bridge overhead. Recursive glob on a **small tree** is on par with node-glob; on **large trees** (e.g. node_modules) Rush-FS wins (see table above).
|`glob` recursive (`**/*.rs`, small tree) vs node-glob |~22 ms |~40 ms |~1.8x (node-glob faster at this scale) |
99
102
100
103
### Where Node.js Wins
101
104
@@ -122,7 +125,7 @@ Single-file operations (`stat`, `readFile`, `writeFile`, `chmod`, etc.) are atom
122
125
123
126
### Key Takeaway
124
127
125
-
**Rush-FS excels at recursive / batch filesystem operations** (readdir, glob, rm, cp) where Rust's parallel walkers deliver 2–70x speedups. For single-file operations it performs on par with Node.js. The napi bridge adds a fixed ~0.3 µs overhead per call, which only matters for sub-microsecond operations like `existsSync`.
128
+
**Rush-FS excels at recursive / batch filesystem operations** (readdir, glob, rm, cp) where Rust's parallel walkers deliver significant speedups (e.g. 12x readdir, 50x copyFile). For single-file operations it performs on par with Node.js. The napi bridge adds a fixed ~0.3 µs overhead per call, which only matters for sub-microsecond operations like `existsSync`.
@@ -136,7 +139,7 @@ Optimal concurrency for `cp` is **4 threads** on Apple Silicon — beyond that,
136
139
137
140
## How it works
138
141
139
-
For the original Node.js, it works serially and cost lots of memory to parse os object and string into JS style:
142
+
For the original Node.js, **for example** on `readdir`, directory reads run serially in the native layer, and each entry is turned into a JS string on the V8 main thread, which adds GC pressure:
140
143
141
144
```mermaid
142
145
graph TD
@@ -161,29 +164,31 @@ graph TD
161
164
E -->|"Return Array"| G["JS Callback/Promise"]
162
165
```
163
166
164
-
But, it's saved with Rust now:
167
+
With Rush-FS, **for example** on `readdir`, the hot path stays in Rust: build a `Vec<String>` (or use Rayon for **recursive** readdir), then hand one array to JS. No per-entry V8 allocation during the walk:
B -->|"Spawn Task"| C{"Rust (or Rayon pool if recursive)"}
170
173
171
174
subgraph "Rust 'Black Box'"
172
-
C -->|"Rayon: Parallel work"| D[OS Kernel]
173
-
D -->|"Syscall: getdents"| C
175
+
C -->|"Syscall: getdents"| D[OS Kernel]
176
+
D -->|"Return file list"| C
174
177
C -->|"Store as Rust Vec<String>"| H[Rust Heap]
175
-
H -->|"No V8 Interaction yet"| H
178
+
H -->|"No V8 yet"| H
176
179
end
177
180
178
181
C -->|"All Done"| I("Convert to JS")
179
182
180
183
subgraph "N-API Bridge"
181
-
I -->|"Batch Create JS Array"| J[V8 Heap]
184
+
I -->|"Batch create JS array"| J[V8 Heap]
182
185
end
183
186
184
187
J -->|Return| K["JS Result"]
185
188
```
186
189
190
+
Other sources of speed in Rush-FS: **recursive `readdir`** uses [jwalk](https://github.com/Byron/jwalk) with a Rayon thread pool for parallel directory traversal; **`cp`** and **`rm`** (recursive) can use Rayon for parallel tree walk and I/O; **`glob`** runs with a configurable number of threads. Across APIs, keeping the hot path in Rust and handing a single result (or batched data) to JS avoids repeated V8/GC overhead compared to Node’s C++ binding.
191
+
187
192
## Status & Roadmap
188
193
189
194
We are rewriting `fs` APIs one by one.
@@ -192,7 +197,7 @@ We are rewriting `fs` APIs one by one.
192
197
>
193
198
> - ✅: Fully Supported
194
199
> - 🚧: Partially Supported / WIP
195
-
> - ✨: New feature from rush-fs
200
+
> - ✨: New feature from @rush-fs/core
196
201
> - ❌: Not Supported Yet
197
202
198
203
### `readdir`
@@ -441,7 +446,7 @@ We are rewriting `fs` APIs one by one.
441
446
withFileTypes?:boolean; // ✅
442
447
exclude?:string[]; // ✅
443
448
concurrency?:number; // ✨
444
-
gitIgnore?:boolean; // ✨
449
+
gitIgnore?:boolean; // ✨ default false (align with Node.js fs.globSync)
0 commit comments