{"name":"globby","version":"16.2.3","keywords":["all","array","directories","expand","files","filesystem","filter","find","fnmatch","folders","fs","glob","globbing","globs","gulpfriendly","match","matcher","minimatch","multi","multiple","paths","pattern","patterns","traverse","util","utility","wildcard","wildcards","promise","gitignore","git"],"author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"globby@16.2.3","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/globby#readme","bugs":{"url":"https://github.com/sindresorhus/globby/issues"},"xo":{"ignores":["fixtures"]},"ava":{"files":["!tests/utilities.js"],"workerThreads":false},"dist":{"shasum":"24fbc7665f283a0f306fcbf2adff596b1200e120","tarball":"http://registry-npm.ywwl.com/globby/download/globby-16.2.3.tgz","fileCount":7,"integrity":"sha512-VZX7TV7jmd/pn71vdnLKtgwy1IWqc3KjI9x1/UtPkwoKk5fKrNLY30ltDe3cAM5xruIN7YuuaulFt133jRrKZg==","signatures":[{"sig":"MEUCIBRczg9ySsjmiwVORRJ5WoxpTmlc87yQ//MVFSDE7eKVAiEAtiL2wtDqfMRVWg86JtD/1w6IfGwEalu7AzDbJ/PITYY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQD3u+V6UufVTewk9jIeMwlDHsF17nI27NiHaLUJruRxBwIhAMdTNi23d4Iuzc+X/bO9Ox0loIU5G8S+l8xeDx7naN/a","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":109728,"size":26535,"noattachment":false,"key":"/globby/-/globby-16.2.3.tgz"},"type":"module","types":"./index.d.ts","engines":{"node":">=20"},"exports":{"types":"./index.d.ts","default":"./index.js"},"funding":"https://github.com/sponsors/sindresorhus","gitHead":"4f95a14d1f85cea7739ee0cb0113cefc4fdd8f9b","scripts":{"test":"xo && ava && tsd","bench":"npm update @globby/main-branch glob-stream fast-glob && node bench.js"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/globby.git","type":"git"},"_npmVersion":"12.0.1","description":"User-friendly glob matching","directories":{},"sideEffects":false,"_nodeVersion":"22.23.1","dependencies":{"slash":"^5.1.0","ignore":"^7.0.5","fast-glob":"^3.3.3","unicorn-magic":"^0.4.0","is-path-inside":"^4.0.0","@sindresorhus/merge-streams":"^4.0.0"},"_hasShrinkwrap":false,"devDependencies":{"xo":"^1.2.2","ava":"^6.4.1","tsd":"^0.33.0","tempy":"^3.1.0","benchmark":"2.1.4","@types/node":"^24.5.2","glob-stream":"^8.0.3","@globby/main-branch":"github:sindresorhus/globby#main"},"_npmOperationalInternal":{"tmp":"tmp/globby_16.2.3_1786105985838_0.38714461093536623","host":"s3://npm-registry-packages-npm-production"},"readme":"# globby\n\n> 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//=> ['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<string[]>` 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//=> ['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//=> ['file.txt', 'image.png', ...]\n\n// Disable expansion: returns empty array\nawait globby(['!*.json'], {expandNegationOnlyPatterns: false});\n//=> []\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//=> []\n\n// ✅ Works\nconst base = convertPathToPattern('C:/Program Files (x86)');\nawait globby(`${base}/*.txt`);\n//=> ['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<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\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<(path: URL | string) => boolean>` 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) => 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<(path: URL | string) => boolean>` 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) => 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","publish_time":1786105985967,"_cnpm_publish_time":1786105985967,"dist-tags":{"latest":"16.2.4","version11":"11.1.0"}}