fdir

The fastest directory crawler & globbing alternative to glob, fast-glob, & tiny-glob. Crawls 1m files in < 1s

MIT 45 个版本
安装
npm install fdir
yarn add fdir
pnpm add fdir
bun add fdir
README

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 builder
const api = new fdir().withFullPaths().crawl("path/to/dir");

// get all files in a directory synchronously
const files = api.sync();

// or asynchronously
api.withPromise().then((files) => {
  // do something with the result here.
});

Documentation:

Documentation for all methods is available here.

📊 Benchmarks:

Please check the benchmark against the latest version here.

🙏Used by:

fdir is downloaded over 200k+ times a week by projects around the world. Here's a list of some notable projects using fdir in production:

Note: if you think your project should be here, feel free to open an issue. Notable is anything with a considerable amount of GitHub stars.

  1. rollup/plugins
  2. SuperchupuDev/tinyglobby
  3. pulumi/pulumi
  4. dotenvx/dotenvx
  5. mdn/yari
  6. streetwriters/notesnook
  7. imba/imba
  8. moroshko/react-scanner
  9. netlify/build
  10. yassinedoghri/astro-i18next
  11. selfrefactor/rambda
  12. whyboris/Video-Hub-App

🦮 LICENSE

Copyright © 2024 Abdullah Atta under MIT. Read full text here.

版本列表
6.5.0 2025-08-14
6.4.6 2025-06-10
6.4.5 2025-05-28
6.4.4 2025-04-19
6.4.3 2025-01-17
6.4.2 2024-10-16
6.4.1 2024-10-16
6.4.0 2024-09-30
6.3.0 2024-08-25
6.2.0 2024-07-22
6.1.1 2023-11-05
6.1.0 2023-08-13
6.0.2 2023-07-31
6.0.1 2023-02-09
6.0.0 2023-02-08
5.3.0 2022-10-18
5.2.1 2022-10-17
5.2.0 2022-01-18
5.1.0 2021-05-21
5.0.0 2021-01-12
4.1.0 2020-08-04
4.0.0 2020-07-27
3.4.3 2020-06-02
3.4.2 2020-05-18
3.4.1 2020-05-17
3.4.0 2020-05-15
3.3.0 2020-05-13
3.2.1 2020-05-12
3.2.0 2020-05-12
3.1.1 2020-05-11
3.1.0 2020-05-11
3.0.0 2020-05-10
2.1.1 2020-04-27
2.1.0 2020-03-21
2.0.3 2020-03-18
2.0.2 2020-03-18
2.0.1 2020-03-16
2.0.0 2020-03-16
1.2.0 2020-03-15
1.1.1 2020-03-14
1.1.0 2020-03-14
1.0.3 2020-03-14
1.0.2 2020-03-13
1.0.1 2020-03-13
1.0.0 2020-03-13