chore(deps): update dependency glob to v11.1.0
All checks were successful
Lint / pre-commit Linting (push) Successful in 1m23s
All checks were successful
Lint / pre-commit Linting (push) Successful in 1m23s
This commit is contained in:
221
node_modules/glob/README.md
generated
vendored
221
node_modules/glob/README.md
generated
vendored
@@ -3,10 +3,12 @@
|
||||
Match files using the patterns the shell uses.
|
||||
|
||||
The most correct and second fastest glob implementation in
|
||||
JavaScript. (See **Comparison to Other JavaScript Glob
|
||||
Implementations** at the bottom of this readme.)
|
||||
JavaScript. (See [**Comparison to Other JavaScript Glob
|
||||
Implementations**](#comparisons-to-other-fnmatchglob-implementations)
|
||||
at the bottom of this readme.)
|
||||
|
||||

|
||||

|
||||
|
||||
## Usage
|
||||
|
||||
@@ -16,8 +18,9 @@ Install with npm
|
||||
npm i glob
|
||||
```
|
||||
|
||||
**Note** the npm package name is _not_ `node-glob` that's a
|
||||
different thing that was abandoned years ago. Just `glob`.
|
||||
> [!NOTE]
|
||||
> The npm package name is _not_ `node-glob` that's a
|
||||
> different thing that was abandoned years ago. Just `glob`.
|
||||
|
||||
```js
|
||||
// load using import
|
||||
@@ -69,8 +72,9 @@ for (const file of g2) {
|
||||
}
|
||||
|
||||
// you can also pass withFileTypes: true to get Path objects
|
||||
// these are like a Dirent, but with some more added powers
|
||||
// check out http://npm.im/path-scurry for more info on their API
|
||||
// these are like a fs.Dirent, but with some more added powers
|
||||
// check out https://isaacs.github.io/path-scurry/classes/PathBase.html
|
||||
// for more info on their API
|
||||
const g3 = new Glob('**/baz/**', { withFileTypes: true })
|
||||
g3.stream().on('data', path => {
|
||||
console.log(
|
||||
@@ -135,13 +139,14 @@ const newFiles = await glob('**', {
|
||||
})
|
||||
```
|
||||
|
||||
**Note** Glob patterns should always use `/` as a path separator,
|
||||
even on Windows systems, as `\` is used to escape glob
|
||||
characters. If you wish to use `\` as a path separator _instead
|
||||
of_ using it as an escape character on Windows platforms, you may
|
||||
set `windowsPathsNoEscape:true` in the options. In this mode,
|
||||
special glob characters cannot be escaped, making it impossible
|
||||
to match a literal `*` `?` and so on in filenames.
|
||||
> [!NOTE]
|
||||
> Glob patterns should always use `/` as a path separator,
|
||||
> even on Windows systems, as `\` is used to escape glob
|
||||
> characters. If you wish to use `\` as a path separator _instead
|
||||
> of_ using it as an escape character on Windows platforms, you may
|
||||
> set `windowsPathsNoEscape:true` in the options. In this mode,
|
||||
> special glob characters cannot be escaped, making it impossible
|
||||
> to match a literal `*` `?` and so on in filenames.
|
||||
|
||||
## Command Line Interface
|
||||
|
||||
@@ -187,7 +192,7 @@ paths found.
|
||||
-x --posix Always resolve to posix style paths, using '/' as the
|
||||
directory separator, even on Windows. Drive letter
|
||||
absolute matches on Windows will be expanded to their
|
||||
full resolved UNC maths, eg instead of 'C:\foo\bar', it
|
||||
full resolved UNC paths, eg instead of 'C:\foo\bar', it
|
||||
will expand to '//?/C:/foo/bar'.
|
||||
|
||||
-f --follow Follow symlinked directories when expanding '**'
|
||||
@@ -362,16 +367,17 @@ Options object is required.
|
||||
|
||||
See full options descriptions below.
|
||||
|
||||
Note that a previous `Glob` object can be passed as the
|
||||
`GlobOptions` to another `Glob` instantiation to re-use settings
|
||||
and caches with a new pattern.
|
||||
> [!NOTE]
|
||||
> A previous `Glob` object can be passed as the
|
||||
> `GlobOptions` to another `Glob` instantiation to re-use settings
|
||||
> and caches with a new pattern.
|
||||
|
||||
Traversal functions can be called multiple times to run the walk
|
||||
again.
|
||||
|
||||
### `g.stream()`
|
||||
|
||||
Stream results asynchronously,
|
||||
Stream results asynchronously.
|
||||
|
||||
### `g.streamSync()`
|
||||
|
||||
@@ -429,35 +435,37 @@ share the previously loaded cache.
|
||||
is used as the starting point for absolute patterns that start
|
||||
with `/`, (but not drive letters or UNC paths on Windows).
|
||||
|
||||
Note that this _doesn't_ necessarily limit the walk to the
|
||||
`root` directory, and doesn't affect the cwd starting point for
|
||||
non-absolute patterns. A pattern containing `..` will still be
|
||||
able to traverse out of the root directory, if it is not an
|
||||
actual root directory on the filesystem, and any non-absolute
|
||||
patterns will be matched in the `cwd`. For example, the
|
||||
pattern `/../*` with `{root:'/some/path'}` will return all
|
||||
files in `/some`, not all files in `/some/path`. The pattern
|
||||
`*` with `{root:'/some/path'}` will return all the entries in
|
||||
the cwd, not the entries in `/some/path`.
|
||||
To start absolute and non-absolute patterns in the same path,
|
||||
you can use `{root:''}`. However, be aware that on Windows
|
||||
systems, a pattern like `x:/*` or `//host/share/*` will
|
||||
_always_ start in the `x:/` or `//host/share` directory,
|
||||
regardless of the `root` setting.
|
||||
|
||||
To start absolute and non-absolute patterns in the same
|
||||
path, you can use `{root:''}`. However, be aware that on
|
||||
Windows systems, a pattern like `x:/*` or `//host/share/*` will
|
||||
_always_ start in the `x:/` or `//host/share` directory,
|
||||
regardless of the `root` setting.
|
||||
> [!NOTE] This _doesn't_ necessarily limit the walk to the
|
||||
> `root` directory, and doesn't affect the cwd starting point
|
||||
> for non-absolute patterns. A pattern containing `..` will
|
||||
> still be able to traverse out of the root directory, if it
|
||||
> is not an actual root directory on the filesystem, and any
|
||||
> non-absolute patterns will be matched in the `cwd`. For
|
||||
> example, the pattern `/../*` with `{root:'/some/path'}`
|
||||
> will return all files in `/some`, not all files in
|
||||
> `/some/path`. The pattern `*` with `{root:'/some/path'}`
|
||||
> will return all the entries in the cwd, not the entries in
|
||||
> `/some/path`.
|
||||
|
||||
- `windowsPathsNoEscape` Use `\\` as a path separator _only_, and
|
||||
_never_ as an escape character. If set, all `\\` characters are
|
||||
replaced with `/` in the pattern.
|
||||
|
||||
Note that this makes it **impossible** to match against paths
|
||||
containing literal glob pattern characters, but allows matching
|
||||
with patterns constructed using `path.join()` and
|
||||
`path.resolve()` on Windows platforms, mimicking the (buggy!)
|
||||
behavior of Glob v7 and before on Windows. Please use with
|
||||
caution, and be mindful of [the caveat below about Windows
|
||||
paths](#windows). (For legacy reasons, this is also set if
|
||||
`allowWindowsEscape` is set to the exact value `false`.)
|
||||
> [!NOTE]
|
||||
> This makes it **impossible** to match against paths
|
||||
> containing literal glob pattern characters, but allows matching
|
||||
> with patterns constructed using `path.join()` and
|
||||
> `path.resolve()` on Windows platforms, mimicking the (buggy!)
|
||||
> behavior of Glob v7 and before on Windows. Please use with
|
||||
> caution, and be mindful of [the caveat below about Windows
|
||||
> paths](#windows). (For legacy reasons, this is also set if
|
||||
> `allowWindowsEscape` is set to the exact value `false`.)
|
||||
|
||||
- `dot` Include `.dot` files in normal matches and `globstar`
|
||||
matches. Note that an explicit dot in a portion of the pattern
|
||||
@@ -492,11 +500,12 @@ share the previously loaded cache.
|
||||
- `nocase` Perform a case-insensitive match. This defaults to
|
||||
`true` on macOS and Windows systems, and `false` on all others.
|
||||
|
||||
**Note** `nocase` should only be explicitly set when it is
|
||||
known that the filesystem's case sensitivity differs from the
|
||||
platform default. If set `true` on case-sensitive file
|
||||
systems, or `false` on case-insensitive file systems, then the
|
||||
walk may return more or less results than expected.
|
||||
> [!NOTE]
|
||||
> `nocase` should only be explicitly set when it is
|
||||
> known that the filesystem's case sensitivity differs from the
|
||||
> platform default. If set `true` on case-sensitive file
|
||||
> systems, or `false` on case-insensitive file systems, then the
|
||||
> walk may return more or less results than expected.
|
||||
|
||||
- `maxDepth` Specify a number to limit the depth of the directory
|
||||
traversal to this many levels below the `cwd`.
|
||||
@@ -509,8 +518,9 @@ share the previously loaded cache.
|
||||
- `nodir` Do not match directories, only files. (Note: to match
|
||||
_only_ directories, put a `/` at the end of the pattern.)
|
||||
|
||||
Note: when `follow` and `nodir` are both set, then symbolic
|
||||
links to directories are also omitted.
|
||||
> [!NOTE]
|
||||
> When `follow` and `nodir` are both set, then symbolic
|
||||
> links to directories are also omitted.
|
||||
|
||||
- `stat` Call `lstat()` on all entries, whether required or not
|
||||
to determine whether it's a valid match. When used with
|
||||
@@ -521,19 +531,30 @@ share the previously loaded cache.
|
||||
- `ignore` string or string[], or an object with `ignored` and
|
||||
`childrenIgnored` methods.
|
||||
|
||||
If a string or string[] is provided, then this is treated as a
|
||||
glob pattern or array of glob patterns to exclude from matches.
|
||||
To ignore all children within a directory, as well as the entry
|
||||
itself, append `'/**'` to the ignore pattern.
|
||||
|
||||
**Note** `ignore` patterns are _always_ in `dot:true` mode,
|
||||
regardless of any other settings.
|
||||
If a string or string[] is provided, then this is treated as
|
||||
a glob pattern or array of glob patterns to exclude from
|
||||
matches. To ignore all children within a directory, as well
|
||||
as the entry itself, append `'/**'` to the ignore pattern.
|
||||
|
||||
If an object is provided that has `ignored(path)` and/or
|
||||
`childrenIgnored(path)` methods, then these methods will be
|
||||
called to determine whether any Path is a match or if its
|
||||
called to determine whether any Path is a match or if its
|
||||
children should be traversed, respectively.
|
||||
|
||||
The `path` argument to the methods will be a
|
||||
[`path-scurry`](https://isaacs.github.io/path-scurry/index.html)
|
||||
[`Path`](https://isaacs.github.io/path-scurry/classes/PathBase)
|
||||
object, which extends
|
||||
[`fs.Dirent`](https://nodejs.org/docs/latest/api/fs.html#class-fsdirent)
|
||||
with additional useful methods like
|
||||
[`.fullpath()`](https://isaacs.github.io/path-scurry/classes/PathBase.html#fullpath),
|
||||
[`.relative()`](https://isaacs.github.io/path-scurry/classes/PathBase.html#relative),
|
||||
and more.
|
||||
|
||||
> [!NOTE]
|
||||
> `ignore` patterns are _always_ in `dot:true` mode,
|
||||
> regardless of any other settings.
|
||||
|
||||
- `follow` Follow symlinked directories when expanding `**`
|
||||
patterns. This can result in a lot of duplicate references in
|
||||
the presence of cyclic links, and make performance quite bad.
|
||||
@@ -542,8 +563,9 @@ share the previously loaded cache.
|
||||
it is not the first item in the pattern, or none if it is the
|
||||
first item in the pattern, following the same behavior as Bash.
|
||||
|
||||
Note: when `follow` and `nodir` are both set, then symbolic
|
||||
links to directories are also omitted.
|
||||
> [!NOTE]
|
||||
> When `follow` and `nodir` are both set, then symbolic
|
||||
> links to directories are also omitted.
|
||||
|
||||
- `realpath` Set to true to call `fs.realpath` on all of the
|
||||
results. In the case of an entry that cannot be resolved, the
|
||||
@@ -564,20 +586,21 @@ share the previously loaded cache.
|
||||
`absolute` may not be used along with `withFileTypes`.
|
||||
|
||||
- `posix` Set to true to use `/` as the path separator in
|
||||
returned results. On posix systems, this has no effect. On
|
||||
returned results. On POSIX systems, this has no effect. On
|
||||
Windows systems, this will return `/` delimited path results,
|
||||
and absolute paths will be returned in their full resolved UNC
|
||||
path form, eg insted of `'C:\\foo\\bar'`, it will return
|
||||
and absolute paths will be returned in their fully resolved UNC
|
||||
path form, e.g. instead of `'C:\\foo\\bar'`, it will return
|
||||
`//?/C:/foo/bar`.
|
||||
|
||||
- `platform` Defaults to value of `process.platform` if
|
||||
- `platform` Defaults to the value of `process.platform` if
|
||||
available, or `'linux'` if not. Setting `platform:'win32'` on
|
||||
non-Windows systems may cause strange behavior.
|
||||
|
||||
- `withFileTypes` Return [PathScurry](http://npm.im/path-scurry)
|
||||
`Path` objects instead of strings. These are similar to a
|
||||
NodeJS `Dirent` object, but with additional methods and
|
||||
properties.
|
||||
- `withFileTypes` Return
|
||||
[`path-scurry`](http://npm.im/path-scurry)
|
||||
[`Path`](https://isaacs.github.io/path-scurry/classes/PathBase.html)
|
||||
objects instead of strings. These are similar to a NodeJS
|
||||
`fs.Dirent` object, but with additional methods and properties.
|
||||
|
||||
`withFileTypes` may not be used along with `absolute`.
|
||||
|
||||
@@ -585,13 +608,15 @@ share the previously loaded cache.
|
||||
triggered.
|
||||
|
||||
- `fs` An override object to pass in custom filesystem methods.
|
||||
See [PathScurry docs](http://npm.im/path-scurry) for what can
|
||||
be overridden.
|
||||
See [`path-scurry`
|
||||
docs](https://isaacs.github.io/path-scurry/interfaces/FSOption.html)
|
||||
for what can be overridden.
|
||||
|
||||
- `scurry` A [PathScurry](http://npm.im/path-scurry) object used
|
||||
to traverse the file system. If the `nocase` option is set
|
||||
explicitly, then any provided `scurry` object must match this
|
||||
setting.
|
||||
- `scurry` A
|
||||
[`PathScurry`](https://isaacs.github.io/path-scurry/classes/PathScurryBase.html)
|
||||
object used to traverse the file system. If the `nocase` option
|
||||
is set explicitly, then any provided `scurry` object must match
|
||||
this setting.
|
||||
|
||||
- `includeChildMatches` boolean, default `true`. Do not match any
|
||||
children of any matches. For example, the pattern `**\/foo`
|
||||
@@ -606,13 +631,6 @@ share the previously loaded cache.
|
||||
`false`, and a custom `Ignore` is provided that does not have
|
||||
an `add()` method, then it will throw an error.
|
||||
|
||||
**Caveat** It _only_ ignores matches that would be a descendant
|
||||
of a previous match, and only if that descendant is matched
|
||||
_after_ the ancestor is encountered. Since the file system walk
|
||||
happens in indeterminate order, it's possible that a match will
|
||||
already be added before its ancestor, if multiple or braced
|
||||
patterns are used.
|
||||
|
||||
For example:
|
||||
|
||||
```js
|
||||
@@ -638,6 +656,15 @@ share the previously loaded cache.
|
||||
one another's file system descendants, or if the occasional
|
||||
included child entry will not cause problems.
|
||||
|
||||
> [!NOTE]
|
||||
> It _only_ ignores matches that would be a descendant
|
||||
> of a previous match, and only if that descendant is matched
|
||||
> _after_ the ancestor is encountered. Since the file system walk
|
||||
> happens in indeterminate order, it's possible that a match will
|
||||
> already be added before its ancestor, if multiple or braced
|
||||
> patterns are used.
|
||||
|
||||
|
||||
## Glob Primer
|
||||
|
||||
Much more information about glob pattern expansion can be found
|
||||
@@ -737,11 +764,12 @@ bsdglob and bash 5, where `**` only has special significance if
|
||||
it is the only thing in a path part. That is, `a/**/b` will match
|
||||
`a/x/y/b`, but `a/**b` will not.
|
||||
|
||||
Note that symlinked directories are not traversed as part of a
|
||||
`**`, though their contents may match against subsequent portions
|
||||
of the pattern. This prevents infinite loops and duplicates and
|
||||
the like. You can force glob to traverse symlinks with `**` by
|
||||
setting `{follow:true}` in the options.
|
||||
> [!NOTE]
|
||||
> Symlinked directories are not traversed as part of a
|
||||
> `**`, though their contents may match against subsequent portions
|
||||
> of the pattern. This prevents infinite loops and duplicates and
|
||||
> the like. You can force glob to traverse symlinks with `**` by
|
||||
> setting `{follow:true}` in the options.
|
||||
|
||||
There is no equivalent of the `nonull` option. A pattern that
|
||||
does not find any matches simply resolves to nothing. (An empty
|
||||
@@ -754,8 +782,8 @@ expanded **first** into the set of `+(a|b)` and `+(a|c)`, and
|
||||
those patterns are checked for validity. Since those two are
|
||||
valid, matching proceeds.
|
||||
|
||||
The character class patterns `[:class:]` (posix standard named
|
||||
classes) style class patterns are supported and unicode-aware,
|
||||
The character class patterns `[:class:]` (POSIX standard named
|
||||
classes) style class patterns are supported and Unicode-aware,
|
||||
but `[=c=]` (locale-specific character collation weight), and
|
||||
`[.symbol.]` (collating symbol), are not.
|
||||
|
||||
@@ -779,13 +807,13 @@ To specify things that should not match, use the `ignore` option.
|
||||
|
||||
**Please only use forward-slashes in glob expressions.**
|
||||
|
||||
Though windows uses either `/` or `\` as its path separator, only
|
||||
Though Windows uses either `/` or `\` as its path separator, only
|
||||
`/` characters are used by this glob implementation. You must use
|
||||
forward-slashes **only** in glob expressions. Back-slashes will
|
||||
always be interpreted as escape characters, not path separators.
|
||||
|
||||
Results from absolute patterns such as `/foo/*` are mounted onto
|
||||
the root setting using `path.join`. On windows, this will by
|
||||
the root setting using `path.join`. On Windows, this will by
|
||||
default result in `/foo/*` matching `C:\foo\bar.txt`.
|
||||
|
||||
To automatically coerce all `\` characters to `/` in pattern
|
||||
@@ -795,7 +823,7 @@ characters**, you may set the `windowsPathsNoEscape` option to
|
||||
|
||||
### Windows, CWDs, Drive Letters, and UNC Paths
|
||||
|
||||
On posix systems, when a pattern starts with `/`, any `cwd`
|
||||
On POSIX systems, when a pattern starts with `/`, any `cwd`
|
||||
option is ignored, and the traversal starts at `/`, plus any
|
||||
non-magic path portions specified in the pattern.
|
||||
|
||||
@@ -955,10 +983,11 @@ performing a glob pattern expansion as faithfully as possible to
|
||||
the behavior of Bash and other sh-like shells, with as much speed
|
||||
as possible.
|
||||
|
||||
Note that prior versions of `node-glob` are _not_ on this list.
|
||||
Former versions of this module are far too slow for any cases
|
||||
where performance matters at all, and were designed with APIs
|
||||
that are extremely dated by current JavaScript standards.
|
||||
> [!NOTE]
|
||||
> Prior versions of `node-glob` are _not_ on this list.
|
||||
> Former versions of this module are far too slow for any cases
|
||||
> where performance matters at all, and were designed with APIs
|
||||
> that are extremely dated by current JavaScript standards.
|
||||
|
||||
---
|
||||
|
||||
@@ -970,9 +999,9 @@ course.</small>
|
||||
|
||||
### Benchmark Results
|
||||
|
||||
First number is time, smaller is better.
|
||||
The first number is time, smaller is better.
|
||||
|
||||
Second number is the count of results returned.
|
||||
The second number is the count of results returned.
|
||||
|
||||
```
|
||||
--- pattern: '**' ---
|
||||
|
||||
Reference in New Issue
Block a user