1.1.1 • Published 7 years ago
disty v1.1.1
disty
Pretty print dist file sizes with only bare minimum of dependencies.
Why
With npm audits and increasingly huge dev tools, I am starting to really want packages that have very shallow dependency trees, so this one has exactly two: bytes and text-table, which both have none.
It installs and boots fast and makes me happy :)
API
const {
printFileStats,
getFormattedStats,
getFileStats
} = require('disty');
printFileStats('path/to/directory', [options]); // prints to console and returns promiseOPTIONS
filter: function given a file path, returns true if it should be includedsort: function given two file objects that sorts themmaxDepth: how many folders deep should it continue (0 is top level only)checkGzip: also estimate gzip size (true by default)bytesOptions: formatting options passed tobytes