{"id":13464908,"url":"https://github.com/terkelg/tiny-glob","last_synced_at":"2025-05-14T13:05:49.990Z","repository":{"id":31905283,"uuid":"129037648","full_name":"terkelg/tiny-glob","owner":"terkelg","description":"Super tiny and ~350% faster alternative to node-glob","archived":false,"fork":false,"pushed_at":"2022-11-10T06:46:04.000Z","size":154,"stargazers_count":853,"open_issues_count":32,"forks_count":26,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-05-12T09:23:48.971Z","etag":null,"topics":["expansion","filesystem","glob","glob-pattern","globbing","pattern-matching","patterns","wildcard"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/terkelg.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-11T05:12:36.000Z","updated_at":"2025-05-08T17:12:56.000Z","dependencies_parsed_at":"2023-01-14T20:05:06.301Z","dependency_job_id":null,"html_url":"https://github.com/terkelg/tiny-glob","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terkelg%2Ftiny-glob","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terkelg%2Ftiny-glob/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terkelg%2Ftiny-glob/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terkelg%2Ftiny-glob/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/terkelg","download_url":"https://codeload.github.com/terkelg/tiny-glob/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253969315,"owners_count":21992266,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["expansion","filesystem","glob","glob-pattern","globbing","pattern-matching","patterns","wildcard"],"created_at":"2024-07-31T14:00:52.587Z","updated_at":"2025-05-14T13:05:49.934Z","avatar_url":"https://github.com/terkelg.png","language":"JavaScript","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/terkelg/tiny-glob/raw/master/tiny-glob.png\" alt=\"Tiny Glob\" width=\"450\" /\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003etiny glob\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://npmjs.org/package/tiny-glob\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/tiny-glob.svg\" alt=\"version\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/terkelg/tiny-glob/actions\"\u003e\n    \u003cimg src=\"https://github.com/terkelg/tiny-glob/actions/workflows/ci.yml/badge.svg\" alt=\"CI\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://npmjs.org/package/tiny-glob\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/dm/tiny-glob.svg\" alt=\"downloads\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://packagephobia.now.sh/result?p=tiny-glob\"\u003e\n    \u003cimg src=\"https://packagephobia.now.sh/badge?p=tiny-glob\" alt=\"install size\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\u003cb\u003eTiny and extremely fast library to match files and folders using glob patterns.\u003c/b\u003e\u003c/p\u003e\n\n\u003cbr /\u003e\n\n\n\"Globs\" is the common name for a specific type of pattern used to match files and folders. It's the patterns you type when you do stuff like `ls *.js` in your shell or put `src/*` in a `.gitignore` file. When used to match filenames, it's sometimes called a \"wildcard\".\n\n\n## Install\n\n```\nnpm install tiny-glob\n```\n\n\n## Core Features\n\n- 🔥 **extremely fast:** ~350% faster than [node-glob](https://github.com/isaacs/node-glob) and ~230% faster than [fast-glob](https://github.com/mrmlnc/fast-glob)\n- 💪 **powerful:** supports advanced globbing patterns (`ExtGlob`)\n- 📦 **tiny**: only ~45 LOC with 2 small dependencies\n- 👫 **friendly**: simple and easy to use api\n- 🎭 **cross-platform**: supports both unix and windows\n\n\n## Usage\n\n```js\nconst glob = require('tiny-glob');\n\n(async function(){\n    let files = await glob('src/*/*.{js,md}');\n    // =\u003e [ ... ] array of matching files\n})();\n```\n\n\n## API\n\n\n### glob(str, options)\n\nType: `function`\u003cbr\u003e\nReturns: `Array`\n\nReturn array of matching files and folders\nThis function is `async` and returns a promise.\n\n#### str\n\nType: `String`\n\nThe glob pattern to match against.\n\u003e **OBS**: Please only use forward-slashes in glob expressions. Even on [windows](#windows)\n\n#### options.cwd\n\nType: `String`\u003cbr\u003e\nDefault: `'.'`\n\nChange default working directory.\n\n#### options.dot\n\nType: `Boolean`\u003cbr\u003e\nDefault: `false`\n\nAllow patterns to match filenames or directories that begin with a period (`.`).\n\n#### options.absolute\n\nType: `Boolean`\u003cbr\u003e\nDefault: `false`\n\nReturn matches as absolute paths.\n\n#### options.filesOnly\n\nType: `Boolean`\u003cbr\u003e\nDefault: `false`\n\nSkip directories and return matched files only.\n\n#### options.flush\n\nType: `Boolean`\u003cbr\u003e\nDefault: `false`\n\nFlush the internal cache object.\n\n\n## Windows\n\nThough Windows may use `/`, `\\`, or `\\\\` as path separators, you can **only** use forward-slashes (`/`) when specifying glob expressions. Any back-slashes (`\\`) will be interpreted as escape characters instead of path separators.\n\nThis is common across many glob-based modules; see [`node-glob`](https://github.com/isaacs/node-glob#windows) for corroboration.\n\n\n## Benchmarks\n\n```\nglob x 13,405 ops/sec ±1.80% (85 runs sampled)\nfast-glob x 25,745 ops/sec ±2.76% (59 runs sampled)\ntiny-glob x 102,658 ops/sec ±0.79% (91 runs sampled)\nFastest is tiny-glob\n┌───────────┬─────────────────────────┬─────────────┬────────────────┐\n│ Name      │ Mean time               │ Ops/sec     │ Diff           │\n├───────────┼─────────────────────────┼─────────────┼────────────────┤\n│ glob      │ 0.00007459990597268128  │ 13,404.843  │ N/A            │\n├───────────┼─────────────────────────┼─────────────┼────────────────┤\n│ fast-glob │ 0.000038842529587611705 │ 25,744.976  │ 92.06% faster  │\n├───────────┼─────────────────────────┼─────────────┼────────────────┤\n│ tiny-glob │ 0.00000974110141018254  │ 102,657.796 │ 298.75% faster │\n└───────────┴─────────────────────────┴─────────────┴────────────────┘\n```\n\n## Advanced Globbing\n\nLearn more about advanced globbing\n\n - [Greg's Wiki](https://mywiki.wooledge.org/glob)\n - [Bash Extended Globbing](https://www.linuxjournal.com/content/bash-extended-globbing)\n\n\n## License\n\nMIT © [Terkel Gjervig](https://terkel.com)\n","funding_links":[],"categories":["JavaScript","命令行","Node","Packages"],"sub_categories":["redux 扩展","macros","文件处理","Others"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterkelg%2Ftiny-glob","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fterkelg%2Ftiny-glob","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterkelg%2Ftiny-glob/lists"}