CityBEM-CityLayers-SaeedRay.../node_modules/get-folder-size
2024-11-05 15:01:14 -05:00
..
bin This commit pushes the node_modules folder separately due to its large size. 2024-11-05 15:01:14 -05:00
example.js This commit pushes the node_modules folder separately due to its large size. 2024-11-05 15:01:14 -05:00
index.js This commit pushes the node_modules folder separately due to its large size. 2024-11-05 15:01:14 -05:00
package.json This commit pushes the node_modules folder separately due to its large size. 2024-11-05 15:01:14 -05:00
README.md This commit pushes the node_modules folder separately due to its large size. 2024-11-05 15:01:14 -05:00
test.js This commit pushes the node_modules folder separately due to its large size. 2024-11-05 15:01:14 -05:00

get-folder-size

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