cspell-glob 10.3.1-alpha.1 → 10.3.2-alpha.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 (2) hide show
  1. package/README.md +19 -2
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -10,10 +10,27 @@ This library doesn't do any file i/o. It uses [micromatch](https://github.com/mi
10
10
 
11
11
  ## Usage
12
12
 
13
+ ```ts
14
+ import { GlobMatcher } from 'cspell-glob';
15
+
16
+ // Patterns behave like the contents of a `.gitignore` file.
17
+ const patterns = ['*.test.js', '!important.test.js'];
18
+
19
+ const matcher = new GlobMatcher(patterns, process.cwd());
20
+
21
+ matcher.match('src/app.test.js'); // true -- matches `*.test.js`
22
+ matcher.match('src/important.test.js'); // false -- excluded by the negated pattern
23
+ matcher.match('src/app.js'); // false -- does not match any pattern
13
24
  ```
14
- const cspellGlob = require('cspell-glob');
15
25
 
16
- // TODO: DEMONSTRATE API
26
+ By default, `GlobMatcher` runs in `exclude` mode (like `.gitignore`). Use `include` mode when searching for
27
+ files to check, where patterns must be more explicit to match:
28
+
29
+ ```ts
30
+ const matcher = new GlobMatcher(['src/**/*.ts'], { root: process.cwd(), mode: 'include' });
31
+
32
+ matcher.match('src/app.ts'); // true
33
+ matcher.match('node_modules/lib/index.ts'); // false
17
34
  ```
18
35
 
19
36
  ## CSpell for Enterprise
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public",
5
5
  "provenance": true
6
6
  },
7
- "version": "10.3.1-alpha.1",
7
+ "version": "10.3.2-alpha.0",
8
8
  "description": "Glob matcher for cspell",
9
9
  "keywords": [
10
10
  "cspell",
@@ -58,7 +58,7 @@
58
58
  "node": ">=22.18.0"
59
59
  },
60
60
  "dependencies": {
61
- "@cspell/url": "10.3.1-alpha.1",
61
+ "@cspell/url": "10.3.2-alpha.0",
62
62
  "picomatch": "^4.0.7"
63
63
  },
64
64
  "devDependencies": {
@@ -66,5 +66,5 @@
66
66
  "@types/picomatch": "^4.0.3",
67
67
  "micromatch": "^4.0.8"
68
68
  },
69
- "gitHead": "aa0576e5b7e666a7e8645939871bcfe4fa2a7eb5"
69
+ "gitHead": "c7193065b82df0646e24ab6f6d370c12148f0efc"
70
70
  }