Skip to content

Node.js module (+ CLI) to calculate folder size efficient (based on fast-folder-size)

License

Notifications You must be signed in to change notification settings

SpraxDev/Fast-Directory-Size

 
 

Repository files navigation

Tests Quality Gate Status

Fast-Directory-Size

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

Compatibility with the original project

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?

Installation

$ npm i https://github.com/SpraxDev/Fast-Directory-Size.git

Usage

Programmatically

import { getDirectorySize } from 'fast-directory-size';

getDirectorySize('./')
    .then((size) => {
      console.log(`${size} bytes`);
    })
    .catch((err) => console.error(err));

Command line

fast-directory-size ./

About

Node.js module (+ CLI) to calculate folder size efficient (based on fast-folder-size)

Topics

Resources

License

Stars

Watchers

Forks

Languages

  • JavaScript 52.7%
  • TypeScript 47.3%