{"versions":{"1.0.1":{"name":"glob-to-regex.js","packageManager":"yarn@4.9.3","publishConfig":{"access":"public"},"version":"1.0.1","description":"Transform GLOB patterns to JavaScript regular expressions for fast file path matching.","author":{"name":"streamich","url":"https://github.com/streamich"},"homepage":"https://github.com/streamich/glob-to-regex","repository":{"type":"git","url":"git+https://github.com/streamich/glob-to-regex.git"},"funding":{"type":"github","url":"https://github.com/sponsors/streamich"},"keywords":["glob","regex","regexp","pattern","matcher","path","filesystem","wildcard"],"engines":{"node":">=10.0"},"main":"lib/index.js","types":"lib/index.d.ts","typings":"lib/index.d.ts","license":"Apache-2.0","scripts":{"format":"biome format ./src","format:fix":"biome format --write ./src","lint":"biome lint ./src","lint:fix":"biome lint --apply ./src","clean":"npx rimraf@6.0.1 lib typedocs coverage gh-pages yarn-error.log","build":"tsc --project tsconfig.build.json --module commonjs --target es2020 --outDir lib","test":"vitest ./src","coverage":"vitest run --coverage","typedoc":"npx typedoc@0.25.13 --tsconfig tsconfig.build.json","build:pages":"npx rimraf@6.0.1 gh-pages && mkdir -p gh-pages && cp -r typedocs/* gh-pages && cp -r coverage gh-pages/coverage","deploy:pages":"gh-pages -d gh-pages","publish-coverage-and-typedocs":"yarn typedoc && yarn coverage && yarn build:pages && yarn deploy:pages"},"peerDependencies":{"tslib":"2"},"devDependencies":{"@biomejs/biome":"^2.1.2","@vitest/coverage-v8":"^3.2.4","config-galore":"^1.0.0","tslib":"^2.8.1","typescript":"^5.8.3","vitest":"^3.2.4"},"_id":"glob-to-regex.js@1.0.1","gitHead":"d1522da4c68c3818a20bd9dde3eaf07c88285b3e","bugs":{"url":"https://github.com/streamich/glob-to-regex/issues"},"_nodeVersion":"24.6.0","_npmVersion":"11.5.1","dist":{"integrity":"sha512-CG/iEvgQqfzoVsMUbxSJcwbG2JwyZ3naEqPkeltwl0BSS8Bp83k3xlGms+0QdWFUAwV+uvo80wNswKF6FWEkKg==","shasum":"f71cc9cb8441471a9318626160bc8a35e1306b21","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/glob-to-regex.js/-/glob-to-regex.js-1.0.1.tgz","fileCount":4,"unpackedSize":11378,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGh/D2XcALiLWI9oW6ClNB3xKei8GdsY2wF+TE95pW7nAiBYo6i2f68pV7daQYSVCUTlTxBUw5tMl2/2hPkaOfWl7g=="}],"size":3889},"_npmUser":{"name":"anonymous","email":"vadimsdaleckis@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"vadimsdaleckis@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/glob-to-regex.js_1.0.1_1756033666286_0.386317580852928"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-08-24T11:07:46.470Z","publish_time":1756033666470,"_source_registry_name":"default","contributors":[]},"1.1.0":{"name":"glob-to-regex.js","packageManager":"yarn@4.9.4","publishConfig":{"access":"public"},"version":"1.1.0","description":"Transform GLOB patterns to JavaScript regular expressions for fast file path matching.","author":{"name":"streamich","url":"https://github.com/streamich"},"homepage":"https://github.com/streamich/glob-to-regex","repository":{"type":"git","url":"git+https://github.com/streamich/glob-to-regex.git"},"funding":{"type":"github","url":"https://github.com/sponsors/streamich"},"keywords":["glob","regex","regexp","pattern","matcher","path","filesystem","wildcard"],"engines":{"node":">=10.0"},"main":"lib/index.js","types":"lib/index.d.ts","typings":"lib/index.d.ts","license":"Apache-2.0","scripts":{"format":"biome format ./src","format:fix":"biome format --write ./src","lint":"biome lint ./src","lint:fix":"biome lint --apply ./src","clean":"npx rimraf@6.0.1 lib typedocs coverage gh-pages yarn-error.log","build":"tsc --project tsconfig.build.json --module commonjs --target es2020 --outDir lib","test":"vitest ./src","coverage":"vitest run --coverage","typedoc":"npx typedoc@0.25.13 --tsconfig tsconfig.build.json","build:pages":"npx rimraf@6.0.1 gh-pages && mkdir -p gh-pages && cp -r typedocs/* gh-pages && cp -r coverage gh-pages/coverage","deploy:pages":"gh-pages -d gh-pages","publish-coverage-and-typedocs":"yarn typedoc && yarn coverage && yarn build:pages && yarn deploy:pages"},"peerDependencies":{"tslib":"2"},"devDependencies":{"@biomejs/biome":"^2.1.2","@vitest/coverage-v8":"^3.2.4","config-galore":"^1.0.0","tslib":"^2.8.1","typescript":"^5.8.3","vitest":"^3.2.4"},"_id":"glob-to-regex.js@1.1.0","gitHead":"e80e79c18cbb93bb138505da022d87a7ff59aacf","bugs":{"url":"https://github.com/streamich/glob-to-regex/issues"},"_nodeVersion":"24.9.0","_npmVersion":"11.6.0","dist":{"integrity":"sha512-y44MUHqM0KXB5NIS/zxmuvaer/9PxsLnNaMDdDyN4m9W7wx115I5Tj/XHtNpuL6x+r4LwRefymkiiiWUfHVNRw==","shasum":"191f07c7e7a87be33399494a3f18f43076ab1562","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/glob-to-regex.js/-/glob-to-regex.js-1.1.0.tgz","fileCount":4,"unpackedSize":11553,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIG3qcYFke2VpQVZJPsOYhfYcBEB686YOoetGha7Gl3W4AiEA/f1zg8vQhHtTUTMX+VR/bmNvNRY4YmwLTpwRvNxzjPE="}],"size":3975},"_npmUser":{"name":"anonymous","email":"vadimsdaleckis@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"vadimsdaleckis@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/glob-to-regex.js_1.1.0_1759444071818_0.28473056380484785"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-10-02T22:27:52.035Z","publish_time":1759444072035,"_source_registry_name":"default","contributors":[]},"1.2.0":{"name":"glob-to-regex.js","packageManager":"yarn@4.9.4","publishConfig":{"access":"public"},"version":"1.2.0","description":"Transform GLOB patterns to JavaScript regular expressions for fast file path matching.","author":{"name":"streamich","url":"https://github.com/streamich"},"homepage":"https://github.com/streamich/glob-to-regex","repository":{"type":"git","url":"git+https://github.com/streamich/glob-to-regex.git"},"funding":{"type":"github","url":"https://github.com/sponsors/streamich"},"keywords":["glob","regex","regexp","pattern","matcher","path","filesystem","wildcard"],"engines":{"node":">=10.0"},"main":"lib/index.js","types":"lib/index.d.ts","typings":"lib/index.d.ts","license":"Apache-2.0","scripts":{"format":"biome format ./src","format:fix":"biome format --write ./src","lint":"biome lint ./src","lint:fix":"biome lint --apply ./src","clean":"npx rimraf@6.0.1 lib typedocs coverage gh-pages yarn-error.log","build":"tsc --project tsconfig.build.json --module commonjs --target es2020 --outDir lib","test":"vitest ./src","coverage":"vitest run --coverage","typedoc":"npx typedoc@0.25.13 --tsconfig tsconfig.build.json","build:pages":"npx rimraf@6.0.1 gh-pages && mkdir -p gh-pages && cp -r typedocs/* gh-pages && cp -r coverage gh-pages/coverage","deploy:pages":"gh-pages -d gh-pages","publish-coverage-and-typedocs":"yarn typedoc && yarn coverage && yarn build:pages && yarn deploy:pages"},"peerDependencies":{"tslib":"2"},"devDependencies":{"@biomejs/biome":"^2.1.2","@vitest/coverage-v8":"^3.2.4","config-galore":"^1.0.0","tslib":"^2.8.1","typescript":"^5.8.3","vitest":"^3.2.4"},"_id":"glob-to-regex.js@1.2.0","gitHead":"bd39c83a44f5a5a2cf1a8bdd7996658c6b93368c","bugs":{"url":"https://github.com/streamich/glob-to-regex/issues"},"_nodeVersion":"24.9.0","_npmVersion":"11.6.0","dist":{"integrity":"sha512-QMwlOQKU/IzqMUOAZWubUOT8Qft+Y0KQWnX9nK3ch0CJg0tTp4TvGZsTfudYKv2NzoQSyPcnA6TYeIQ3jGichQ==","shasum":"2b323728271d133830850e32311f40766c5f6413","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/glob-to-regex.js/-/glob-to-regex.js-1.2.0.tgz","fileCount":4,"unpackedSize":15981,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCh8VyUpWpmS/tI6Eda+81EszLGMtzQPqP9te4RUAMXTQIhAKdvLDbPvUf7VuT+gL85BxGI81RtBqb8xB8FUdyrPV4/"}],"size":4963},"_npmUser":{"name":"anonymous","email":"vadimsdaleckis@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"vadimsdaleckis@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/glob-to-regex.js_1.2.0_1759496971685_0.24592518077960257"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-10-03T13:09:31.841Z","publish_time":1759496971841,"_source_registry_name":"default","contributors":[]}},"dist-tags":{"latest":"1.2.0"},"name":"glob-to-regex.js","time":{"created":"2025-08-24T11:07:52.204Z","modified":"2025-10-03T13:09:37.471Z","1.0.1":"2025-08-24T11:07:46.470Z","1.1.0":"2025-10-02T22:27:52.035Z","1.2.0":"2025-10-03T13:09:31.841Z"},"readme":"# glob-to-regex.js\n\nTransform GLOB patterns to JavaScript regular expressions for fast file path matching.\n\nThis tiny library converts familiar shell-style glob patterns like `**/*.ts` or `src/{a,b}/**/*.js` into JavaScript `RegExp` objects and provides a convenient matcher utility.\n\n## Install\n\n```bash\nyarn add glob-to-regex.js\n# or\nnpm i glob-to-regex.js\n```\n\n## Quick start\n\n```ts\nimport {toRegex, toMatcher} from 'glob-to-regex.js';\n\n// Build a RegExp from a glob\nconst re = toRegex('src/**/test.ts');\nre.test('src/a/b/test.ts'); // true\nre.test('src/test.ts');     // true\nre.test('src/test.tsx');    // false\n\n// Build a predicate function from a pattern or an array of patterns\nconst match = toMatcher(['**/*.ts', '!**/*.d.ts']); // negative patterns are not special; use a RegExp if needed\nmatch('index.ts');    // true\nmatch('types.d.ts');  // true (negation is not parsed specially)\n```\n\n## API\n\n- toRegex(pattern: string): RegExp\n\t- Converts a glob pattern to an anchored regular expression (`^...$`).\n\n- toMatcher(pattern: string | RegExp | Array<string | RegExp>): (path: string) => boolean\n\t- Accepts a glob string, a RegExp, or an array of them. If given an array, it returns true if any item matches (logical OR, short-circuited).\n\t- Strings starting with `/` and ending with `/flags?` are treated as regular expressions (e.g. `\"/\\\\.test\\\\.ts$/\"`).\n\n## Supported glob features\n\n- `/` separates path segments\n- `*` matches zero or more characters within a single segment (does not cross `/`)\n- `?` matches exactly one character within a single segment\n- `**` matches across path segments, including none\n- `{a,b,c}` alternation groups (no nesting). Each item inside can itself contain glob syntax\n- Character classes: `[abc]`, `[a-z]`, `[!a-z]`, `[!abc]`\n- **Extended globbing** (when `extglob: true` option is set):\n  - `?(pattern-list)` matches zero or one occurrence of the given patterns\n  - `*(pattern-list)` matches zero or more occurrences of the given patterns\n  - `+(pattern-list)` matches one or more occurrences of the given patterns\n  - `@(pattern-list)` matches exactly one of the given patterns\n  - `!(pattern-list)` matches anything except one of the given patterns\n  - Pattern lists use `|` as separator (e.g., `@(jpg|png|gif)`)\n\nNotes:\n- The produced RegExp is anchored at start and end (`^...$`).\n- Character classes are copied through to the output regex. Use standard JavaScript class syntax.\n- Brace groups are not nestable. If an unmatched `{` is found, it is treated literally.\n\n## Examples\n\n```ts\ntoRegex('a/b/c.txt').test('a/b/c.txt'); // true\ntoRegex('a/*.txt').test('a/file.txt');  // true\ntoRegex('a/*.txt').test('a/x/y.txt');   // false\ntoRegex('file?.js').test('file1.js');   // true\ntoRegex('src/**/test.ts').test('src/a/b/test.ts'); // true\ntoRegex('assets/**').test('assets/a/b.png');       // true\ntoRegex('*.{html,txt}').test('page.html');         // true\ntoRegex('src/{a,b}/**/*.ts').test('src/b/x/y.ts'); // true\ntoRegex('file[0-9].txt').test('file5.txt');        // true\ntoRegex('file[!0-9].txt').test('filea.txt');       // true\ntoRegex('**/*.[jt]s{,x}').test('dir/a/b.jsx');     // true\n\n// Extended globbing examples\ntoRegex('file?(s).txt', {extglob: true}).test('file.txt');  // true\ntoRegex('file?(s).txt', {extglob: true}).test('files.txt'); // true\ntoRegex('file.@(jpg|png|gif)', {extglob: true}).test('file.jpg'); // true\ntoRegex('/var/log/!(*.gz)', {extglob: true}).test('/var/log/syslog'); // true\ntoRegex('/var/log/!(*.gz)', {extglob: true}).test('/var/log/error.log.gz'); // false\ntoRegex('src/**/!(*.test).js', {extglob: true}).test('src/app.test.js'); // false\ntoRegex('src/**/!(*.test).js', {extglob: true}).test('src/index.js'); // true\n```\n\n## TypeScript\n\nTypes are bundled. The library targets modern Node.js and browsers.\n\n## Performance\n\n`toRegex` performs a single pass over the pattern and creates a native RegExp. Matching is then performed by V8's highly optimized engine.\n\n## Limitations\n\n- Brace groups are not nested.\n- Negated globs like `!**/*.d.ts` are not parsed specially. If you need exclusion, combine multiple matchers or filter results separately.\n\n## License\n\nApache-2.0 © streamich","users":{}}