Node Module (+CLI) module to calculate the size of a directory.
It uses:
- Sysinternals DU on Windows, which is automatically downloaded during the installation
- native
du
on other platforms
This version of fast-directory-size
should be fully compatible with version 1.3.0
of the
original project. You can see a list of my changes in
the compare view.
I forked the project because I wanted to use it in my project, but it was lacking TypeScript typings. At that time, I thought it was easier just forking the project and recode it in TypeScript. Then I started restructuring the project to feel more like my projects... You see where this is going, right?
$ npm i https://github.com/SpraxDev/Fast-Directory-Size.git
import { getDirectorySize } from 'fast-directory-size';
getDirectorySize('./')
.then((size) => {
console.log(`${size} bytes`);
})
.catch((err) => console.error(err));
fast-directory-size ./