An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

        

[![codecov](https://codecov.io/gh/mkwtys/bundle-size/branch/master/graph/badge.svg)](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 packages

Usage
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)