fast-glob
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
@nodelib/fs.stat | 2.0.5 | 4.08 kB | MIT | prod | |
@nodelib/fs.walk | 1.2.8 | 7.19 kB | MIT | prod | |
glob-parent | 5.1.2 | 4.74 kB | ISC | prod | |
merge2 | 1.4.1 | 3.33 kB | MIT | prod | |
micromatch | 4.0.5 | 14.09 kB | MIT | prod |
Fast-glob is a rapid and effective glob library for Node.js. This software provides methods to traverse the file system, returning pathnames that conform to a specified set of patterns, which are based on the rules utilized by Unix Bash shell with some simplifications. The package's results are delivered in an arbitrary order, striking a balance between speed, simplicity, and effectiveness.
To use Fast-glob, you typically start by installing it via the npm package manager using the following command in your terminal:
npm install fast-glob
Afterwards, you can integrate this library into your Node.js application. Here are a few examples of how Fast-glob can be used:
Asynchronous mode:
const fg = require('fast-glob');
const entries = await fg(['.editorconfig', '**/index.js'], { dot: true });
// ['.editorconfig', 'services/index.js']
Synchronous mode:
const fg = require('fast-glob');
const entries = fg.sync(['.editorconfig', '**/index.js'], { dot: true });
// ['.editorconfig', 'services/index.js']
Stream mode:
const fg = require('fast-glob');
const stream = fg.stream(['.editorconfig', '**/index.js'], { dot: true });
for await (const entry of stream) {
console.log(entry);
// .editorconfig
// services/index.js
}
These examples depict different ways you can use Fast-glob to peruse through the file system.
You can access Fast-glob's comprehensive documentation directly from the project's GitHub page. The documentation includes a highlight of the package's features, details on how to install and use the package, and information about pattern syntax used by the package. Other sections found in the documentation include the API Guide, Options, Helpers, FAQ, Benchmarks, Changelog, and License. Please visit Fast-glob GitHub Documentation for further information about the package.