@rust-gear/glob 0.2.7 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +15 -20
  2. package/index.d.ts +2 -0
  3. package/package.json +26 -14
package/README.md CHANGED
@@ -1,15 +1,10 @@
1
1
  # @rust-gear/glob
2
2
 
3
- A high-performance napi-rs glob library powered by Rust's [globset](https://docs.rs/globset).
3
+ A fast glob alternative for Node.js powered by Rust.
4
4
 
5
- ## Performance
5
+ ## Performance
6
6
 
7
- Significantly faster than Node.js built-in `fs.globSync`:
8
-
9
- - **2-3x faster** for typical glob patterns
10
- - **8x faster** for large file sets (5000+ files)
11
-
12
- Based on benchmarks with 4,000-12,000 files across various patterns.
7
+ - **3–10x faster** than traditional JavaScript glob implementations.
13
8
 
14
9
  ## Installation
15
10
 
@@ -20,28 +15,28 @@ npm install --save-dev @rust-gear/glob
20
15
  ## Usage
21
16
 
22
17
  ```js
23
- import { globSync, glob } from "@rust-gear/glob";
24
-
25
- const files = globSync("src/**/*.rs");
18
+ import * as rs from "@rust-gear/glob";
26
19
 
27
- const filesAsync = await glob("src/**/*.rs");
20
+ const filesAsync = await rs.glob("src/**/*.rs");
28
21
 
29
- const files = globSync("**/*.rs", {
22
+ const files = rs.globSync("**/*.rs", {
30
23
  cwd: "src",
31
24
  exclude: ["**/test/**", "**/target/**"],
32
25
  });
33
26
  ```
34
27
 
35
- > **Return path type:**
36
- > Absolute patterns return absolute paths.
37
- > Relative patterns return paths relative to the specified `cwd`.
28
+ > **Return paths:**
29
+ > Absolute patterns absolute paths
30
+ > Relative patterns paths relative to `cwd`
38
31
 
39
32
  ## Options
40
33
 
41
- | Option | Type | Description |
42
- | :------ | :------- | :-------------------------------------- |
43
- | cwd | string | Current working directory for searching |
44
- | exclude | string[] | Array of glob patterns to exclude |
34
+ | Option | Type | Default | Description |
35
+ | :------ | :------- | :-------------- | :-------------------------------------- |
36
+ | cwd | string | `process.cwd()` | Current working directory for searching |
37
+ | exclude | string[] | `[]` | Glob patterns to exclude |
38
+ | dot | boolean | `false` | Include dot files and directories |
39
+ | sort | boolean | `false` | Return sorted results |
45
40
 
46
41
  ## License
47
42
 
package/index.d.ts CHANGED
@@ -6,6 +6,8 @@
6
6
  export interface GlobOptions {
7
7
  exclude?: Array<string>
8
8
  cwd?: string
9
+ dot?: boolean
10
+ sort?: boolean
9
11
  }
10
12
  export declare function globSync(patterns: string | Array<string>, options?: GlobOptions | undefined | null): Array<string>
11
13
  export declare function glob(patterns: string | Array<string>, options?: GlobOptions | undefined | null): Promise<Array<string>>
package/package.json CHANGED
@@ -1,12 +1,24 @@
1
1
  {
2
2
  "name": "@rust-gear/glob",
3
- "version": "0.2.7",
4
- "description": "Node.js bindings for Rust glob library",
3
+ "version": "1.0.0",
4
+ "description": "A fast glob alternative for Node.js powered by Rust.",
5
5
  "keywords": [
6
- "rust-gear",
7
6
  "glob",
8
- "napi",
9
- "napi-rs"
7
+ "globset",
8
+ "fast-glob",
9
+ "fast glob",
10
+ "glob alternative",
11
+ "file search",
12
+ "file matching",
13
+ "file system",
14
+ "directory traversal",
15
+ "rust",
16
+ "napi-rs",
17
+ "node",
18
+ "nodejs",
19
+ "native",
20
+ "high-performance",
21
+ "parallel"
10
22
  ],
11
23
  "repository": {
12
24
  "type": "git",
@@ -53,14 +65,14 @@
53
65
  "@napi-rs/cli": "^2.18.4"
54
66
  },
55
67
  "optionalDependencies": {
56
- "@rust-gear/glob-darwin-arm64": "0.2.7",
57
- "@rust-gear/glob-darwin-x64": "0.2.7",
58
- "@rust-gear/glob-linux-arm64-gnu": "0.2.7",
59
- "@rust-gear/glob-linux-arm64-musl": "0.2.7",
60
- "@rust-gear/glob-linux-x64-gnu": "0.2.7",
61
- "@rust-gear/glob-linux-x64-musl": "0.2.7",
62
- "@rust-gear/glob-win32-arm64-msvc": "0.2.7",
63
- "@rust-gear/glob-win32-ia32-msvc": "0.2.7",
64
- "@rust-gear/glob-win32-x64-msvc": "0.2.7"
68
+ "@rust-gear/glob-darwin-arm64": "1.0.0",
69
+ "@rust-gear/glob-darwin-x64": "1.0.0",
70
+ "@rust-gear/glob-linux-arm64-gnu": "1.0.0",
71
+ "@rust-gear/glob-linux-arm64-musl": "1.0.0",
72
+ "@rust-gear/glob-linux-x64-gnu": "1.0.0",
73
+ "@rust-gear/glob-linux-x64-musl": "1.0.0",
74
+ "@rust-gear/glob-win32-arm64-msvc": "1.0.0",
75
+ "@rust-gear/glob-win32-ia32-msvc": "1.0.0",
76
+ "@rust-gear/glob-win32-x64-msvc": "1.0.0"
65
77
  }
66
78
  }