提交学习笔记专用
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

91 lines
3.8 KiB

  1. <p align="center">
  2. <img src="https://github.com/thecodrr/fdir/raw/master/assets/fdir.gif" width="75%"/>
  3. <h1 align="center">The Fastest Directory Crawler & Globber for NodeJS</h1>
  4. <p align="center">
  5. <a href="https://www.npmjs.com/package/fdir"><img src="https://img.shields.io/npm/v/fdir?style=for-the-badge"/></a>
  6. <a href="https://www.npmjs.com/package/fdir"><img src="https://img.shields.io/npm/dw/fdir?style=for-the-badge"/></a>
  7. <a href="https://codeclimate.com/github/thecodrr/fdir/maintainability"><img src="https://img.shields.io/codeclimate/maintainability-percentage/thecodrr/fdir?style=for-the-badge"/></a>
  8. <a href="https://coveralls.io/github/thecodrr/fdir?branch=master"><img src="https://img.shields.io/coveralls/github/thecodrr/fdir?style=for-the-badge"/></a>
  9. <a href="https://www.npmjs.com/package/fdir"><img src="https://img.shields.io/bundlephobia/minzip/fdir?style=for-the-badge"/></a>
  10. <a href="https://www.producthunt.com/posts/fdir-every-millisecond-matters"><img src="https://img.shields.io/badge/ProductHunt-Upvote-red?style=for-the-badge&logo=product-hunt"/></a>
  11. <a href="https://dev.to/thecodrr/how-i-wrote-the-fastest-directory-crawler-ever-3p9c"><img src="https://img.shields.io/badge/dev.to-Read%20Blog-black?style=for-the-badge&logo=dev.to"/></a>
  12. <a href="./LICENSE"><img src="https://img.shields.io/github/license/thecodrr/fdir?style=for-the-badge"/></a>
  13. </p>
  14. </p>
  15. **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.**
  16. 💡 **Stupidly Easy:** `fdir` uses expressive Builder pattern to build the crawler increasing code readability.
  17. 🤖 **Zero Dependencies\*:** `fdir` only uses NodeJS `fs` & `path` modules.
  18. 🕺 **Astonishingly Small:** < 2KB in size gzipped & minified.
  19. 🖮 **Hackable:** Extending `fdir` is extremely simple now that the new Builder API is here. Feel free to experiment around.
  20. _\* `picomatch` must be installed manually by the user to support globbing._
  21. ## 🚄 Quickstart
  22. ### Installation
  23. You can install using `npm`:
  24. ```sh
  25. $ npm i fdir
  26. ```
  27. or Yarn:
  28. ```sh
  29. $ yarn add fdir
  30. ```
  31. ### Usage
  32. ```ts
  33. import { fdir } from "fdir";
  34. // create the builder
  35. const api = new fdir().withFullPaths().crawl("path/to/dir");
  36. // get all files in a directory synchronously
  37. const files = api.sync();
  38. // or asynchronously
  39. api.withPromise().then((files) => {
  40. // do something with the result here.
  41. });
  42. ```
  43. ## Documentation:
  44. Documentation for all methods is available [here](/documentation.md).
  45. ## 📊 Benchmarks:
  46. Please check the benchmark against the latest version [here](/BENCHMARKS.md).
  47. ## 🙏Used by:
  48. `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:
  49. > 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.
  50. 1. [rollup/plugins](https://github.com/rollup/plugins)
  51. 2. [SuperchupuDev/tinyglobby](https://github.com/SuperchupuDev/tinyglobby)
  52. 3. [pulumi/pulumi](https://github.com/pulumi/pulumi)
  53. 4. [dotenvx/dotenvx](https://github.com/dotenvx/dotenvx)
  54. 5. [mdn/yari](https://github.com/mdn/yari)
  55. 6. [streetwriters/notesnook](https://github.com/streetwriters/notesnook)
  56. 7. [imba/imba](https://github.com/imba/imba)
  57. 8. [moroshko/react-scanner](https://github.com/moroshko/react-scanner)
  58. 9. [netlify/build](https://github.com/netlify/build)
  59. 10. [yassinedoghri/astro-i18next](https://github.com/yassinedoghri/astro-i18next)
  60. 11. [selfrefactor/rambda](https://github.com/selfrefactor/rambda)
  61. 12. [whyboris/Video-Hub-App](https://github.com/whyboris/Video-Hub-App)
  62. ## 🦮 LICENSE
  63. Copyright &copy; 2024 Abdullah Atta under MIT. [Read full text here.](https://github.com/thecodrr/fdir/raw/master/LICENSE)