dist-size

0.4.0 • Public • Published

dist-size

NPM version NPM downloads CircleCI donate

preview

Install

yarn global add dist-size
# or 
npm i -g dist-size

Usage

# print file sizes for `./dist` folder 
dist-size
 
# or anywhere 
dist-size ./path/to/folder
 
# or custom extensions 
dist-size -e js,css
# defaults to `*` (any extension) 

API

const distSize = require('dist-size')
 
distSize({
  baseDir,
  extensions,
  sort,
  limit,
  displayRelativePath,
  displayTotal
}).then(res => {
  for (const file of res.toJson()) {
    console.log(file)
    //=>
    {
      name,
      path,
      size,
      gzip
    }
  }
})

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Author

dist-size © EGOIST, Released under the MIT License.
Authored and maintained by EGOIST with help from contributors (list).

github.com/egoist · GitHub @EGOIST · Twitter @_egoistlily

Readme

Keywords

none

Package Sidebar

Install

npm i dist-size

Weekly Downloads

76

Version

0.4.0

License

MIT

Last publish

Collaborators

  • rem