0.4.0 • Published 6 years ago
dist-size v0.4.0
dist-size
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
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- 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