Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add better links to path-scurry docs #609

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ 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(
Expand Down Expand Up @@ -534,6 +534,12 @@ share the previously loaded cache.
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.

- `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.
Expand Down Expand Up @@ -574,9 +580,9 @@ share the previously loaded cache.
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
- `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`.
Expand All @@ -585,10 +591,10 @@ 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
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
- `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.
Expand Down
Loading