
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
Get the size of a folder by iterating through its subfiles and folders
npm i sizeable
npm i -g sizeable
var sizeable = require('sizeable');
sizeable(myFolderPath, [options or ignore regex pattern], callback);
Example:
var sizeable = require('sizeable');
var folder = '/my/folder/path';
sizeable(folder, function callback(err, size, details) {
if (err) {
throw err;
}
console.log(size, 'bytes');
console.log(sizeable.toKb(size), 'Kb');
console.log(sizeable.toMb(size), 'Mb');
console.log(sizeable.toGb(size), 'Gb');
console.log(sizeable.toTb(size), 'Tb');
console.log(sizeable.toFormat(size, 'b'), 'bytes');
console.log(sizeable.toFormat(size, 'kb'), 'Kb'); // Valid format 'b', 'kb', 'mb', 'gb' and 'tb' (Ignore case)
});
var sizeable = require('sizeable');
var folder = '/my/folder/path';
var ignore = /node_modules/;
sizeable(folder, ignore, function callback(err, size, details) {
if (err) {
throw err;
}
sizeable.detailsSizeTo(details, 'mb', function(err, details) {
if (err) {
throw err;
}
console.log(JSON.stringify(details, null, 2));
});
});
var sizeable = require('sizeable');
var folder = '/my/folder/path';
var ignore = /node_modules/;
sizeable(folder, ignore, function callback(err, size, details) {
if (err) {
throw err;
}
sizeable.detailsSizeTo(details, 'mb', function(err, details) {
if (err) {
throw err;
}
sizeable.sortDetailsBySize(details, function(err, details) {
if (err) {
throw err;
}
console.log(JSON.stringify(details, null, 2));
});
});
});
Regular expresion for ignore folders or files
Ignore all files
sizeable -f /my/folder/path -i "node_modules|.git"
# ~> 12.32 mb
sizeable -f /my/folder/path -i "node_modules|.git" -F gb
# ~> 0.12 gb
For show more information use -h
sizeable -h
MIT
FAQs
Get the size of a folder by iterating through its subfiles and folders.
We found that sizeable demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.