https://github.com/bendrucker/browserify-size
Get the browserified size of a module after minification and gzipping
https://github.com/bendrucker/browserify-size
Last synced: about 1 year ago
JSON representation
Get the browserified size of a module after minification and gzipping
- Host: GitHub
- URL: https://github.com/bendrucker/browserify-size
- Owner: bendrucker
- License: mit
- Created: 2015-07-07T12:01:24.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2020-05-25T04:10:22.000Z (about 6 years ago)
- Last Synced: 2024-11-19T00:46:28.161Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 28.3 KB
- Stars: 17
- Watchers: 3
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# browserify-size [](https://travis-ci.org/bendrucker/browserify-size) [](https://greenkeeper.io/)
> Get the browserified size of a module after minification and gzipping
## Install
```
$ npm install --save browserify-size
```
For the CLI:
```
$ npm install --global browserify-size
```
## Usage
API
```js
var browserifySize = require('browserify-size')
browserifySize('xtend', callback)
//=> callback(null, 366)
```
CLI
```sh
# arg
$ browserify-size xtend
# stdin
$ echo xtend | browserify-size
#=> 366 B
```
## API
#### `browserifySize(name, [options], callback)` -> `undefined`
##### name
*Required*
Type: `string`
The package name or a path to a local package.
##### options
###### version
Type: `string`
Default: `''`
The package version to use. Only applies when downloading from npm.
###### cwd
Type: `string`
Default: `process.cwd()`
##### callback
*Required*
Type: `function`
Arguments: `err, bytes`
A callback to be called with the number of bytes in the resulting bundle after minification and gzipping.
## License
MIT © [Ben Drucker](http://bendrucker.me)