Skip to content

TBroz15/fdir-size

Repository files navigation

fdir-size |⚡ Fastest Directory Size Calculator!

Buy Me A Coffee NPM Downloads NPM Version

The Fastest*: Can sum ~100k file sizes in a second!

🤏 Microscopic Small: No bin files, just pure ol' Javascript. The source code itself is minified to only 0.4 KB!

📦 Just One Package: fdir-size uses it's one and only spine, fdir!

🍋 Easy Peasy: Just one function will do!

*The fastest in NodeJS, some other programming languages can top that! Please check out the benchmark page for more.

Please support the creator of fdir, @thecoddr for making this project possible!

Usage

Prerequisites

  • NodeJS 14.14.0 or above
  • Any JS package manager
import getDirSize from "fdir-size";

const MB = 1000 * 1000;

// This sample directory has 100 files that has 1 MB each.
const dir = "./../my_directory";

const size = await getDirSize(dir);

// Console Output:
//   "./../my_directory" stores 100 MB.
console.log(`"${dir}" stores ${size / MB} MB.`);

For usages, benchmarks, and tips, please check out the wiki page!

About

⚡ Fastest Directory Size Calculator at Sub-second!

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published