fdir-size
v1.0.3
Published
⚡ Fastest Directory Size Calculator at Sub-second!
Downloads
46
Maintainers
Readme
fdir-size |⚡ Fastest Directory Size Calculator!
⚡ 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.`);
Wiki
For usages, benchmarks, and tips, please check out the wiki page!