1.3.0 • Published 9 months ago

fast-dir-size v1.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

fast-dir-size

Calculates the total size of a folder and its subfolders.

Usage

Install with npm

npm i fast-dir-size
// load using import
import { getDirSize, getDirSizeSync } from 'fast-dir-size'
// or using commonjs
const { getDirSize, getDirSizeSync } = require('fast-dir-size')


const os = require('os');
const { join } = require('path');
const path = join(os.homedir(), 'Downloads');

// Example using asynchronous function
getDirSize(path)
  .then((size) => console.log(`Size: ${size} bytes`)); // Output: Size: 338160322 bytes

// Example using synchronous function
const size = getDirSizeSync(path);
console.log(`Size: ${size} bytes`); // Output: Size: 338160322 bytes
1.3.0

9 months ago

1.2.0

9 months ago

1.0.1

10 months ago

1.0.0

10 months ago