The Fastest Directory Crawler & Globber for NodeJS
⚡ The Fastest: Nothing similar (in the NodeJS world) beats fdir in speed. It can easily crawl a directory containing 1 million files in < 1 second.
💡 Stupidly Easy:fdir uses expressive Builder pattern to build the crawler increasing code readability.
🤖 Zero Dependencies*:fdir only uses NodeJS fs & path modules.
🕺 Astonishingly Small: < 2KB in size gzipped & minified.
🖮 Hackable: Extending fdir is extremely simple now that the new Builder API is here. Feel free to experiment around.
* picomatch must be installed manually by the user to support globbing.
🚄 Quickstart
Installation
You can install using npm:
$ npm i fdir
or Yarn:
$ yarn add fdir
Usage
import { fdir } from "fdir";// create the builderconst api = new fdir().withFullPaths().crawl("path/to/dir");// get all files in a directory synchronouslyconst files = api.sync();// or asynchronouslyapi.withPromise().then((files) => { // do something with the result here.});