Skip to content
ed9506bbaf
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
codeql-action/node_modules/get-folder-size/
codeql-action/node_modules/get-folder-size/

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
bin
August 16, 2022 11:54
August 16, 2022 11:54

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