{"id":51119052,"url":"https://github.com/sulthonzh/globmatch","last_synced_at":"2026-06-25T00:30:39.961Z","repository":{"id":365065311,"uuid":"1268665278","full_name":"sulthonzh/globmatch","owner":"sulthonzh","description":"Zero-dep glob pattern matcher — *, **, ?, [abc], {a,b}, negation, brace expansion","archived":false,"fork":false,"pushed_at":"2026-06-15T17:29:09.000Z","size":8,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-15T19:21:56.502Z","etag":null,"topics":["glob","match","micromatch","minimatch","pattern","wildcard"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sulthonzh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-13T19:49:33.000Z","updated_at":"2026-06-15T17:19:17.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sulthonzh/globmatch","commit_stats":null,"previous_names":["sulthonzh/globmatch"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/sulthonzh/globmatch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sulthonzh%2Fglobmatch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sulthonzh%2Fglobmatch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sulthonzh%2Fglobmatch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sulthonzh%2Fglobmatch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sulthonzh","download_url":"https://codeload.github.com/sulthonzh/globmatch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sulthonzh%2Fglobmatch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34755061,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-24T02:00:07.484Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["glob","match","micromatch","minimatch","pattern","wildcard"],"created_at":"2026-06-25T00:30:39.903Z","updated_at":"2026-06-25T00:30:39.955Z","avatar_url":"https://github.com/sulthonzh.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# globmatch\n\nZero-dependency glob pattern matcher for Node.js. Supports the full set of common glob features without pulling in a massive dependency tree.\n\n## Why?\n\nMost glob libraries are either huge (`micromatch` + its dependency tree) or too limited (`minimatch` quirks). `globmatch` gives you the patterns you actually need — `*`, `**`, `?`, `[abc]`, `{a,b}`, negation — in ~200 lines with zero deps.\n\n## Install\n\n```bash\nnpm install globmatch\n```\n\n## Usage\n\n### Library\n\n```js\nconst { match, filter, matcher } = require('globmatch');\n\n// Basic matching\nmatch('file.js', '*.js');              // true\nmatch('file.ts', '*.js');              // false\n\n// Globstar — crosses directory boundaries\nmatch('src/deep/nested/x.js', '**/*.js');  // true\n\n// Character classes\nmatch('b', '[abc]');                   // true\nmatch('file.js', 'file.[jt]s');        // true\n\n// Brace expansion\nmatch('app.jsx', '*.{js,ts,jsx}');     // true\nmatch('src/lib/x.js', 'src/{lib,bin}/**');  // true\n\n// Negation\nmatch('src/index.js', '!node_modules/**');  // true\n\n// Filter arrays\nfilter(['a.js', 'b.ts', 'c.js'], '*.js');   // ['a.js', 'c.js']\n\n// Pre-compiled matcher (faster for repeated use)\nconst isJs = matcher('*.js');\n['a.js', 'b.ts'].filter(isJs);  // ['a.js']\n```\n\n### Options\n\n```js\nmatch('FILE.JS', '*.js', { nocase: true });     // true (case-insensitive)\nmatch('.env', '*env', { dot: true });            // true (* matches leading dot)\nmatch('a/b/c', '**', { noglobstar: true });      // false (** treated as *)\n```\n\n### CLI\n\n```bash\n# Test a single match\nglobmatch \"*.js\" src/index.js\n\n# Filter stdin\nfind . -type f | globmatch \"**/*.{js,ts}\"\n\n# Match against a list\nglobmatch \"*.test.js\" --list a.test.js b.spec.js c.test.js\n\n# JSON output\nglobmatch \"src/**\" --json --list src/a.js lib/b.js\n\n# From file\nglobmatch \"*.js\" -f filelist.txt\n\n# Invert (non-matching lines)\nfind . -type f | globmatch --invert \"node_modules/**\"\n```\n\n## Supported Patterns\n\n| Pattern | Meaning |\n|---------|---------|\n| `*` | Match zero or more chars (except `/`) |\n| `**` | Match zero or more path segments |\n| `?` | Match exactly one char (except `/` or `.`) |\n| `[abc]` | Match any char in set |\n| `[a-z]` | Match any char in range |\n| `[!abc]` | Match any char NOT in set |\n| `{a,b,c}` | Brace expansion (match any alternative) |\n| `!pattern` | Negation |\n| `a\\|b` | Alternation |\n\n## API\n\n### `match(str, pattern, opts?)` → `boolean`\nTest if a string matches a glob pattern.\n\n### `filter(list, pattern, opts?)` → `string[]`\nFilter an array of strings.\n\n### `isMatch(str, pattern, opts?)` → `boolean`\nAlias for `match()`.\n\n### `matcher(pattern, opts?)` → `function`\nCreate a pre-compiled matcher function. Faster for repeated matching.\n\n### `expandBraces(pattern)` → `string[]`\nExpand brace patterns into all combinations.\n\n### `globToRegex(pattern, opts?)` → `RegExp`\nConvert a single glob pattern (no braces) to a RegExp.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsulthonzh%2Fglobmatch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsulthonzh%2Fglobmatch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsulthonzh%2Fglobmatch/lists"}