get-folder-size
    Overview
    Documentation
    Tutorials
    Insights
    Code
    Dependencies
    Contributors
    Jobs

get-folder-size

Get the size of a folder by recursively iterating through all its sub(files && folders).

2.0.1  •  Updated 1 years ago  •  by Alexandru Vlăduţu  •  MIT License

Get the size of a folder by iterating through its sub-files and folders.

Usage

getFolderSize(folder, [regexIgnorePattern], callback)

Example:

const getSize = require('get-folder-size');

getSize(myFolder, (err, size) => {
  if (err) { throw err; }

  console.log(size + ' bytes');
  console.log((size / 1024 / 1024).toFixed(2) + ' MB');
});

CLI tool

npm i -g get-folder-size
get-folder-size --folder=/my/folder --ignore=node_modules

Size vs Size on disk

This module calculates the actual file size, and not the size on disk.

License

MIT

Popularity

Weekly Downloads
36.1K
Stars
34

Maintenance

Development

Last ver 1 year ago
Created 6 years ago
Last commit 1 year ago
3 months between commits

Technology

Node version: 10.14.0
5.8K unpacked

Compliance

MIT License
OSI Approved
0 vulnerabilities

Contributors

5 contributors
Alexandru Vladutu
Maintainer, 16 commits, 3 merges
Ethan Davis
1 commits, 1 PRs
Bryan Leboff
1 commits, 1 PRs
Javier Castro
1 commits
jacargentina
1 PRs

Tags

folder
size
Openbase helps developers choose among and use millions of open-source packages, so they can build amazing products faster.
FacebookTwitterLinkedIn
© 2020 Devstore, Inc.