https://github.com/mkwtys/bundle-size
Show bundle file size of npm packages
https://github.com/mkwtys/bundle-size
browserify bundle size
Last synced: 3 months ago
JSON representation
Show bundle file size of npm packages
- Host: GitHub
- URL: https://github.com/mkwtys/bundle-size
- Owner: mkwtys
- License: mit
- Created: 2016-04-22T17:57:18.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2025-02-02T09:15:22.000Z (4 months ago)
- Last Synced: 2025-02-27T00:11:54.726Z (4 months ago)
- Topics: browserify, bundle, size
- Language: JavaScript
- Homepage:
- Size: 986 KB
- Stars: 14
- Watchers: 3
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://codecov.io/gh/mkwtys/bundle-size)
# bundle-size
Show bundle file size of npm packages
## Installation
```sh
$ npm install bundle-size
```## Usage
### in CLI
```sh
$ bundle-size --help
Show bundle file size of npm packagesUsage
bundle-size [packages] [options]Options
-e, --env set NODE_ENV
-h, --help show help
-r, --reporter output style (json)
-v, --version print version
```#### Example:
```sh
bundle-size react
bundle-size react --env development
bundle-size react -e development -e production
```### in Node.js module
```js
const bundleSize = require('bundle-size');bundleSize(['react', 'redux'], { env: ['development', 'production'] }).then((results) => {
console.log(results);
});// [email protected], [email protected]
//
// env bundle minify gzip
// -- 178 kB 89.8 kB 28.2 kB
// development 176 kB 84.2 kB 27.6 kB
// production 176 kB 67 kB 21.2 kB
```## License
MIT © [mkwtys](https://github.com/mkwtys)