Skip to content
/ disty Public

Pretty-print dist file sizes with only bare minimum of dependencies

License

Notifications You must be signed in to change notification settings

skiano/disty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

disty

Pretty-print dist file sizes with minimal dependencies.

why

With npm audits and increasingly huge dev tools, I wanted a solution for this that requires very few other tools.

It installs and boots fast and makes me happy :)

dependencies

Package What Why
bytes zero-dependency human readible file sizes improves api for input/output
text-table zero-dependency ascii tablualar data better printing for output

Installation

$ npm i disty

Use in package.json

{
  "scripts": {
    "size": "disty --path dist"
  }
}

Node API

const { printFileStats } = require('disty');

printFileStats('path/to/directory', [options]); // prints to console and returns promise

OPTIONS

  • filter: function given a file path, returns true if it should be included
  • sort: function given two file objects that sorts them
  • maxDepth: how many folders deep should it continue (0 is top level only)
  • checkGzip: also estimate gzip size (true by default)
  • bytesOptions: formatting options passed to bytes

About

Pretty-print dist file sizes with only bare minimum of dependencies

Resources

License

Stars

Watchers

Forks

Packages

No packages published