{"name":"zeptomatch","repository":{"type":"git","url":"git+https://github.com/fabiospampinato/zeptomatch.git"},"description":"An absurdly small glob matcher that packs a punch.","version":"1.2.2","type":"module","main":"dist/index.js","exports":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"clean":"tsex clean","compile":"tsex compile","compile:watch":"tsex compile --watch","test":"tsex test","test:watch":"tsex test --watch","prepublishOnly":"tsex prepare"},"keywords":["tiny","glob","match","matcher"],"dependencies":{"grammex":"^3.1.1"},"devDependencies":{"fava":"^0.2.0","tsex":"^3.0.1","typescript":"^5.1.6"},"gitHead":"9b7c2c857180ae828da67d09ad4d023c44a2b5ff","bugs":{"url":"https://github.com/fabiospampinato/zeptomatch/issues"},"homepage":"https://github.com/fabiospampinato/zeptomatch#readme","_id":"zeptomatch@1.2.2","_nodeVersion":"18.12.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-0ETdzEO0hdYmT8aXHHf5aMjpX+FHFE61sG4qKFAoJD2Umt3TWdCmH7ADxn2oUiWTlqBGC+SGr8sYMfr+37J8pQ==","shasum":"4abe1fe743ed3eef7d83239eba93a6bed6eee4fb","tarball":"http://registry-npm.ywwl.com/zeptomatch/download/zeptomatch-1.2.2.tgz","fileCount":27,"unpackedSize":148602,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCxygOEcoo0ez4ZSVAY4CBQuGsmLVbGYOue6RBD+9vW9gIhALV8OLjU3QqY7NXMNcqSurT+Z5tjMpS2mdFfw5mvBc1j"}],"size":19387,"noattachment":false,"key":"/zeptomatch/-/zeptomatch-1.2.2.tgz"},"_npmUser":{"name":"fabiospampinato","email":"spampinabio@gmail.com"},"directories":{},"maintainers":[{"name":"fabiospampinato","email":"spampinabio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/zeptomatch_1.2.2_1701197820321_0.29605607179635807"},"_hasShrinkwrap":false,"readme":"# Zeptomatch\n\nAn absurdly small glob matcher that packs a punch.\n\n## Overview\n\nThe following syntax is supported:\n\n| Syntax      | Description                                                                                                                             |\n| ----------- | --------------------------------------------------------------------------------------------------------------------------------------- |\n| `*`         | Matches any character, except for the path separator, zero or more times.                                                               |\n| `**`        | Matches any character zero or more times. If it doesn't span the entire length of a path segment it's interpreted as a `*` instead.     |\n| `?`         | Matches any character, except for the path separator, one time.                                                                         |\n| `\\`         | Matches the character after it in the glob literally. This is the escape operator.                                                      |\n| `[abc]`     | Matches any of the characters in the class one time.                                                                                    |\n| `[a-z]`     | Matches any of the characters in the range in the class one time.                                                                       |\n| `[^abc]`    | Matches any character, except for the characters the class, and the path separator, o∏ne time. Aliased as `[!abc]` also.                 |\n| `[^a-z]`    | Matches any character, except for the characters in the range in the class, and the path separator, one time. Aliased as `[!a-z]` also. |\n| `{foo,bar}` | Matches any of the alternations, which are separated by a comma, inside the braces.                                                     |\n| `{01..99}`  | Matches any of the numbers in the expanded range. Padding is supported and opt-in.                                                      |\n| `{a..zz}`   | Matches any of the strings in the expanded range. Upper-cased ranges are supported and opt-in.                                          |\n| `!glob`     | Matches anything except the provided glob. Negations can only be used at the start of the glob.                                         |\n| `!!glob`    | Matches the provided glob. Negations can only be used at the start of the glob.                                                         |\n\nAdditional features and details:\n\n- Zeptomatch works pretty similarly to [`picomatch`](https://github.com/micromatch/picomatch), since 1000+ of its tests are being used by this library.\n- Zeptomatch is opinionated, there are no options at all, which helps with keeping it tiny and manageable.\n- Zeptomatch is automatically memoized, the only ways to use it are always the most optimized ones available.\n- Zeptomatch automatically normalizes path separators, since matching Windows-style paths would most likely be a mistake.\n- Zeptomatch supports compiling a glob to a standalone regular expression.\n- Zeptomatch doesn't do anything special for file names starting with a dot.\n- Zeptomatch supports nesting braces indefinitely.\n\nLimitations:\n\n- POSIX classes (e.g. `[:alnum:]`) are not supported. Implementing them seems a bit out of scope for a \"zepto\"-level library.\n- Extglobs (e.g. `?(foo)`) are not supported. They might be in the future though.\n\n## Install\n\n```sh\nnpm install --save zeptomatch\n```\n\n## Usage\n\n```ts\nimport zeptomatch from 'zeptomatch';\n\n// Check if a glob matches a path\n\nzeptomatch ( '*.js', 'abcd' ); // => false\nzeptomatch ( '*.js', 'a.js' ); // => true\nzeptomatch ( '*.js', 'a.md' ); // => false\nzeptomatch ( '*.js', 'a/b.js' ); // => false\n\n// Compile a glob to a regular expression\n\nconst re = zeptomatch.compile ( '*.js' ); // => /^[^/]*\\.js$/s\n```\n\n## Utilities\n\nThe following additional utilities are available, as standalone packages:\n\n- [`zeptomatch-escape`](https://github.com/fabiospampinato/zeptomatch-escape): A little utility for escaping globs before passing them to zeptomatch.\n\n## License\n\nMIT © Fabio Spampinato\n","publish_time":1701197820593,"_cnpm_publish_time":1701197820593,"dist-tags":{"latest":"2.1.0"}}