fdir-size
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

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!

Package Sidebar

Install

npm i fdir-size

Weekly Downloads

45

Version

1.0.3

License

MIT

Unpacked Size

4.65 kB

Total Files

6

Last publish

Collaborators

  • tbroz15