dirsizes
v1.1.0
Published
This checks the size of all dirs and files and sorts them by size
Downloads
3
Maintainers
Readme
Do you ever wanted to see what game is the largest? No problem. This can help. This thing is written with 0 dependencies.
Installation (for cmd only use)
npm i -g dirsizes
Installation (for module use)
npm i dirsizes
usage (cmd)
dirsizes <path>
here is an example how it could look
usage (module)
const dirsizes = require("dirsizes");
/**
* optional. set the logging functions. this are the default values
*/
dirSizes.setOnLog((...args) => {
console.log(...args);
});
dirSizes.setOnLogWON(args => {
process.stdout.write(args);
});
// check sizes. these are the default values
// first one is the path to the folder to check
// second one is if the values should be prettyfied
console.log(dirSizes.getSize("./", true));
/*
returns
{
dirs: { 'folderB': '234.0 B', 'folderA': '123.0 B' },
files: {
'fileA.txt': '1.0 GB',
'fileB.txt': '200.0 KB',
'fileC.txt': '1.0 MB',
},
timeTook: { milliseconds: 6 }
}
*/