0.4.0 • Published 6 years ago

dist-size v0.4.0

Weekly downloads
34
License
MIT
Repository
github
Last release
6 years ago

dist-size

NPM version NPM downloads CircleCI donate

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