{"id":13410707,"url":"https://github.com/sindresorhus/globby","last_synced_at":"2026-10-19T08:00:08.259Z","repository":{"id":18031222,"uuid":"21069494","full_name":"sindresorhus/globby","owner":"sindresorhus","description":"User-friendly glob matching","archived":false,"fork":false,"pushed_at":"2026-08-19T17:04:33.000Z","size":315,"stargazers_count":2647,"open_issues_count":0,"forks_count":141,"subscribers_count":21,"default_branch":"main","last_synced_at":"2026-10-12T13:43:55.268Z","etag":null,"topics":["directories","files","glob","globbing","javascript","matching","nodejs","patterns"],"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/sindresorhus.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":".github/security.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"claude":null,"gemini":null,"cursor":null,"copilot":null,"dco":null,"cla":null,"disclosure":null},"funding":{"github":"sindresorhus","open_collective":"sindresorhus","buy_me_a_coffee":"sindresorhus","custom":"https://sindresorhus.com/donate"}},"created_at":"2014-06-21T13:48:39.000Z","updated_at":"2026-10-09T03:22:29.000Z","dependencies_parsed_at":"2026-08-08T14:37:00.988Z","dependency_job_id":"75f9cc4a-4a6b-4ee7-971d-481bd3e686af","html_url":"https://github.com/sindresorhus/globby","commit_stats":{"total_commits":217,"total_committers":50,"mean_commits":4.34,"dds":"0.49769585253456217","last_synced_commit":"c000568bd20c97d94397c71ec22df4e1c5f41d47"},"previous_names":[],"tags_count":59,"template":false,"template_full_name":null,"purl":"pkg:github/sindresorhus/globby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fglobby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fglobby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fglobby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fglobby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sindresorhus","download_url":"https://codeload.github.com/sindresorhus/globby/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sindresorhus%2Fglobby/sbom","scorecard":{"id":826335,"data":{"date":"2025-08-11","repo":{"name":"github.com/sindresorhus/globby","commit":"60d7de54476f9ba9734c1b6923fba39d6589de5f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.3,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: .github/security.md:1","Info: Found linked content: .github/security.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: .github/security.md:1","Info: Found text in security policy: .github/security.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Code-Review","score":3,"reason":"Found 11/30 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/sindresorhus/globby/main.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/sindresorhus/globby/main.yml/main?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/main.yml:25","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/main.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: license:0","Info: FSF or OSI recognized license: MIT License: license:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 11 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T16:42:22.652Z","repository_id":18031222,"created_at":"2025-08-23T16:42:22.652Z","updated_at":"2025-08-23T16:42:22.652Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":343843146,"owners_count":38238210,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-10-03T21:59:58.778Z","status":"online","status_checked_at":"2026-10-12T02:00:06.297Z","response_time":96,"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":["directories","files","glob","globbing","javascript","matching","nodejs","patterns"],"created_at":"2024-07-30T20:01:08.551Z","updated_at":"2026-10-19T08:00:08.235Z","avatar_url":"https://github.com/sindresorhus.png","language":"JavaScript","funding_links":["https://github.com/sponsors/sindresorhus","https://opencollective.com/sindresorhus","https://buymeacoffee.com/sindresorhus","https://sindresorhus.com/donate"],"categories":["JavaScript","Packages","Repository","GIT 仓库","包","目录","Filesystem","Utilities","nodejs","Uncategorized","Node"],"sub_categories":["Filesystem","文件系统","React Components","Uncategorized","文件处理"],"readme":"# globby\n\n\u003e User-friendly glob matching\n\nBased on [`fast-glob`](https://github.com/mrmlnc/fast-glob) but adds a bunch of useful features.\n\n## Features\n\n- Promise API\n- Multiple patterns\n- Negated patterns: `['foo*', '!foobar']`\n- Negation-only patterns: `['!foobar']` → matches all files except `foobar`\n- Expands directories: `foo` → `foo/**/*`\n- Supports `.gitignore` and similar ignore config files\n- Supports `URL` as `cwd`\n\n## Install\n\n```sh\nnpm install globby\n```\n\n## Usage\n\n```\n├── unicorn\n├── cake\n└── rainbow\n```\n\n```js\nimport {globby} from 'globby';\n\nconst paths = await globby(['*', '!cake']);\n\nconsole.log(paths);\n//=\u003e ['unicorn', 'rainbow']\n```\n\n## API\n\nNote that glob patterns can only contain forward-slashes, not backward-slashes, so if you want to construct a glob pattern from path components, you need to use `path.posix.join()` instead of `path.join()`.\n\n**Windows:** Patterns with backslashes will silently fail. Use `path.posix.join()` or [`convertPathToPattern()`](#convertpathtopatternpath).\n\n### globby(patterns, options?)\n\nReturns a `Promise\u003cstring[]\u003e` of matching paths.\n\n#### patterns\n\nType: `string | string[]`\n\nSee supported `minimatch` [patterns](https://github.com/isaacs/minimatch#usage).\n\n#### options\n\nType: `object`\n\nSee the [`fast-glob` options](https://github.com/mrmlnc/fast-glob#options-3) in addition to the ones below.\n\n##### expandDirectories\n\nType: `boolean | string[] | object`\\\nDefault: `true`\n\nIf set to `true`, `globby` will automatically glob directories for you. If you define an `Array` it will only glob files that matches the patterns inside the `Array`. You can also define an `object` with `files` and `extensions` like below:\n\n```js\nimport {globby} from 'globby';\n\nconst paths = await globby('images', {\n\texpandDirectories: {\n\t\tfiles: ['cat', 'unicorn', '*.jpg'],\n\t\textensions: ['png']\n\t}\n});\n\nconsole.log(paths);\n//=\u003e ['cat.png', 'unicorn.png', 'cow.jpg', 'rainbow.jpg']\n```\n\nNote that if you set this option to `false`, you won't get back matched directories unless you set `onlyFiles: false`.\n\n##### gitignore\n\nType: `boolean`\\\nDefault: `false`\n\nRespect ignore patterns in `.gitignore` files that apply to the globbed files.\n\nWhen enabled, globby searches for `.gitignore` files from the current working directory downward, and if a Git repository is detected (by finding a `.git` directory), it also respects `.gitignore` files in parent directories up to the repository root. This matches Git's actual behavior where patterns from parent `.gitignore` files apply to subdirectories.\n\nGitignore patterns take priority over user patterns, matching Git's behavior. To include gitignored files, set this to `false`.\n\nThe `ignore` option applies to the results only. A pattern that could name an ignore file, such as `'**/.gitignore'`, is not used when searching for the ignore files, so it hides them from the results without disabling this option.\n\n**Performance:** Globby reads `.gitignore` files before globbing and hands fast-glob patterns for the directories it can prove are ignored, so whole ignored directories (like large `node_modules` or build outputs) are skipped during traversal instead of being enumerated and filtered afterwards. This holds even when negation patterns (like `!important.log`) or parent `.gitignore` files are present: only the rules that provably cannot be re-included by a negation are used to skip directories, while the final filtering always matches Git's behavior. To read fewer ignore files, use `ignoreFiles: '.gitignore'` to target only the root ignore file.\n\n##### globalGitignore\n\nType: `boolean`\\\nDefault: `false`\n\nRespect ignore patterns in the global gitignore file configured via `git config core.excludesfile`.\n\nValues from `[include]` and `gitdir` or `gitdir/i` `[includeIf]` sections inside those user-level config files are also respected.\n\nPatterns in the global gitignore are treated as root-level patterns, matching Git's own behavior.\n\nThis option only reads the user-level Git config (`GIT_CONFIG_GLOBAL`, `$XDG_CONFIG_HOME/git/config`, and `~/.gitconfig`). When `core.excludesfile` is unset, it falls back to Git's default user-level ignore file at `$XDG_CONFIG_HOME/git/ignore` or `~/.config/git/ignore`. Repository `.git/config` and system config are intentionally not consulted. Other `includeIf` predicates such as `onbranch:` are intentionally not supported.\n\n##### ignoreFiles\n\nType: `string | string[]`\\\nDefault: `undefined`\n\nGlob patterns to look for ignore files, which are then used to ignore globbed files.\n\nThis is a more generic form of the `gitignore` option, allowing you to find ignore files with a [compatible syntax](http://git-scm.com/docs/gitignore). For instance, this works with Babel's `.babelignore`, Prettier's `.prettierignore`, or ESLint's `.eslintignore` files.\n\nThe `ignore` option applies to the results only, as with the [`gitignore`](#gitignore) option.\n\n**Performance tip:** Using a specific path like `'.gitignore'` is much faster than recursive patterns.\n\n##### expandNegationOnlyPatterns\n\nType: `boolean`\\\nDefault: `true`\n\nWhen only negation patterns are provided (e.g., `['!*.json']`), automatically prepend a catch-all pattern (`**/*`) to match all files before applying negations.\n\nSet to `false` to return an empty array when only negation patterns are provided. This can be useful when patterns are user-controlled, to avoid unexpectedly matching all files.\n\n```js\nimport {globby} from 'globby';\n\n// Default behavior: matches all files except .json\nawait globby(['!*.json']);\n//=\u003e ['file.txt', 'image.png', ...]\n\n// Disable expansion: returns empty array\nawait globby(['!*.json'], {expandNegationOnlyPatterns: false});\n//=\u003e []\n```\n\n##### fs\n\nType: [`FileSystemAdapter`](https://github.com/mrmlnc/fast-glob#fs)\\\nDefault: `undefined`\n\nCustom file system implementation (useful for testing or virtual file systems).\n\n**Note:** When using `gitignore`, `ignoreFiles`, or `globalGitignore`, the custom fs must also provide `readFile`/`readFileSync` methods. With `globalGitignore`, `globby()` and `globbyStream()` also require `fs.promises.stat` or `fs.stat`, and `globbySync()` requires `fs.statSync`.\n\n### globbySync(patterns, options?)\n\nReturns `string[]` of matching paths.\n\n### globbyStream(patterns, options?)\n\nReturns a [`stream.Readable`](https://nodejs.org/api/stream.html#stream_readable_streams) of matching paths.\n\nFor example, loop over glob matches in a [`for await...of` loop](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of) like this:\n\n```js\nimport {globbyStream} from 'globby';\n\nfor await (const path of globbyStream('*.tmp')) {\n\tconsole.log(path);\n}\n```\n\n### convertPathToPattern(path)\n\nConverts a path to a pattern by escaping special glob characters like `()`, `[]`, `{}`. On Windows, also converts backslashes to forward slashes.\n\nUse this when your literal paths contain characters with special meaning in globs.\n\n```js\nimport {globby, convertPathToPattern} from 'globby';\n\n// ❌ Fails - parentheses are glob syntax\nawait globby('C:/Program Files (x86)/*.txt');\n//=\u003e []\n\n// ✅ Works\nconst base = convertPathToPattern('C:/Program Files (x86)');\nawait globby(`${base}/*.txt`);\n//=\u003e ['C:/Program Files (x86)/file.txt']\n```\n\n[Learn more.](https://github.com/mrmlnc/fast-glob#convertpathtopatternpath)\n\n### generateGlobTasks(patterns, options?)\n\nReturns an `Promise\u003cobject[]\u003e` in the format `{patterns: string[], options: Object}`, which can be passed as arguments to [`fast-glob`](https://github.com/mrmlnc/fast-glob). This is useful for other globbing-related packages.\n\nNote that you should avoid running the same tasks multiple times as they contain a file system cache. Instead, run this method each time to ensure file system changes are taken into consideration.\n\n### generateGlobTasksSync(patterns, options?)\n\nReturns an `object[]` in the format `{patterns: string[], options: Object}`, which can be passed as arguments to [`fast-glob`](https://github.com/mrmlnc/fast-glob). This is useful for other globbing-related packages.\n\nTakes the same arguments as `generateGlobTasks`.\n\n### isDynamicPattern(patterns, options?)\n\nReturns a `boolean` of whether there are any special glob characters in the `patterns`.\n\nNote that the options affect the results.\n\nThis function is backed by [`fast-glob`](https://github.com/mrmlnc/fast-glob#isdynamicpatternpattern-options).\n\n### isGitIgnored(options?)\n\nReturns a `Promise\u003c(path: URL | string) =\u003e boolean\u003e` indicating whether a given path is ignored via a `.gitignore` file.\n\n#### options\n\nType: `object`\n\n##### cwd\n\nType: `URL | string`\\\nDefault: `process.cwd()`\n\nThe current working directory in which to search.\n\n##### suppressErrors\n\nType: `boolean`\\\nDefault: `false`\n\nSuppress errors when encountering directories or files without read permissions.\n\n##### deep\n\nType: `number`\\\nDefault: `Infinity`\n\nMaximum depth to search for `.gitignore` files.\n\n- `0` - Only search in the start directory\n- `1` - Search in the start directory and one level of subdirectories\n- `2` - Search in the start directory and two levels of subdirectories\n\n##### ignore\n\nType: `string | string[]`\\\nDefault: `[]`\n\nGlob patterns to exclude from `.gitignore` file search.\n\nUnlike the `ignore` option of [`globby()`](#options), which applies to the results only, this one excludes files from the search itself, so a pattern that names an ignore file stops that file from being read.\n\n##### followSymbolicLinks\n\nType: `boolean`\\\nDefault: `true`\n\nIndicates whether to traverse descendants of symbolic link directories.\n\n##### concurrency\n\nType: `number`\\\nDefault: `os.cpus().length`\n\nSpecifies the maximum number of concurrent requests from a reader to read directories.\n\n##### throwErrorOnBrokenSymbolicLink\n\nType: `boolean`\\\nDefault: `false`\n\nThrow an error when symbolic link is broken if `true` or safely return `lstat` call if `false`.\n\n##### fs\n\nType: [`FileSystemAdapter`](https://github.com/mrmlnc/fast-glob#fs)\\\nDefault: `undefined`\n\nCustom file system implementation (useful for testing or virtual file systems).\n\n**Note:** The custom fs must provide `readFile`/`readFileSync` methods for reading `.gitignore` files.\n\n```js\nimport {isGitIgnored} from 'globby';\n\nconst isIgnored = await isGitIgnored();\n\nconsole.log(isIgnored('some/file'));\n```\n\n```js\n// Suppress errors when encountering unreadable directories\nconst isIgnored = await isGitIgnored({suppressErrors: true});\n```\n\n```js\n// Limit search depth and exclude certain directories\nconst isIgnored = await isGitIgnored({\n\tdeep: 2,\n\tignore: ['**/node_modules/**', '**/dist/**']\n});\n```\n\n### isGitIgnoredSync(options?)\n\nReturns a `(path: URL | string) =\u003e boolean` indicating whether a given path is ignored via a `.gitignore` file.\n\nSee [`isGitIgnored`](#isgitignoredoptions) for options.\n\n\n### isIgnoredByIgnoreFiles(patterns, options?)\n\nReturns a `Promise\u003c(path: URL | string) =\u003e boolean\u003e` indicating whether a given path is ignored via the ignore files.\n\nThis is a more generic form of the `isGitIgnored` function, allowing you to find ignore files with a [compatible syntax](http://git-scm.com/docs/gitignore). For instance, this works with Babel's `.babelignore`, Prettier's `.prettierignore`, or ESLint's `.eslintignore` files.\n\n#### patterns\n\nType: `string | string[]`\n\nGlob patterns to look for ignore files.\n\n#### options\n\nType: `object`\n\nSee [`isGitIgnored` options](#isgitignoredoptions) for all available options.\n\n```js\nimport {isIgnoredByIgnoreFiles} from 'globby';\n\nconst isIgnored = await isIgnoredByIgnoreFiles(\"**/.gitignore\");\n\nconsole.log(isIgnored('some/file'));\n```\n\n```js\n// Suppress errors when encountering unreadable directories\nconst isIgnored = await isIgnoredByIgnoreFiles(\"**/.eslintignore\", {suppressErrors: true});\n```\n\n```js\n// Limit search depth and concurrency\nconst isIgnored = await isIgnoredByIgnoreFiles(\"**/.prettierignore\", {\n\tdeep: 3,\n\tconcurrency: 4\n});\n```\n\n### isIgnoredByIgnoreFilesSync(patterns, options?)\n\nReturns a `(path: URL | string) =\u003e boolean` indicating whether a given path is ignored via the ignore files.\n\nThis is a more generic form of the `isGitIgnoredSync` function, allowing you to find ignore files with a [compatible syntax](http://git-scm.com/docs/gitignore). For instance, this works with Babel's `.babelignore`, Prettier's `.prettierignore`, or ESLint's `.eslintignore` files.\n\nSee [`isIgnoredByIgnoreFiles`](#isignoredbyignorefilespatterns-options) for patterns and options.\n\n```js\nimport {isIgnoredByIgnoreFilesSync} from 'globby';\n\nconst isIgnored = isIgnoredByIgnoreFilesSync(\"**/.gitignore\");\n\nconsole.log(isIgnored('some/file'));\n```\n\n## Globbing patterns\n\nJust a quick overview.\n\n- `*` matches any number of characters, but not `/`\n- `?` matches a single character, but not `/`\n- `**` matches any number of characters, including `/`, as long as it's the only thing in a path part\n- `{}` allows for a comma-separated list of \"or\" expressions\n- `!` at the beginning of a pattern will negate the match\n\n### Negation patterns\n\nGlobby supports negation patterns to exclude files. There are two ways to use them:\n\n**With positive patterns:**\n```js\nawait globby(['src/**/*.js', '!src/**/*.test.js']);\n// Matches all .js files except test files\n```\n\n**Negation-only patterns:**\n```js\nawait globby(['!*.json', '!*.xml'], {cwd: 'config'});\n// Matches all files in config/ except .json and .xml files\n```\n\nWhen using only negation patterns, globby implicitly prepends `**/*` to match all files, then applies the negations. This means `['!*.json', '!*.xml']` is equivalent to `['**/*', '!*.json', '!*.xml']`.\n\n**Note:** The prepended `**/*` pattern respects the `dot` option. By default, dotfiles (files starting with `.`) are not matched unless you set `dot: true`.\n\n[Various patterns and expected matches.](https://github.com/sindresorhus/multimatch/blob/main/test/test.js)\n\n## Related\n\n- [multimatch](https://github.com/sindresorhus/multimatch) - Match against a list instead of the filesystem\n- [matcher](https://github.com/sindresorhus/matcher) - Simple wildcard matching\n- [del](https://github.com/sindresorhus/del) - Delete files and directories\n- [make-dir](https://github.com/sindresorhus/make-dir) - Make a directory and its parents if needed\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fglobby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsindresorhus%2Fglobby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsindresorhus%2Fglobby/lists"}