Socket
Socket
Sign inDemoInstall

build-size

Package Overview
Dependencies
59
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    build-size

Parse and compare build sizes


Version published
Weekly downloads
2
Maintainers
2
Install size
717 kB
Created
Weekly downloads
 

Readme

Source

build-size

Node Version Latest Version on NPM Code Style Software License Run Status Code Coverage Made by SWIS

Parse and compare build size

Install

Install locally with npm:

$ npm install --save-dev build-size

Install globally with npm:

$ npm install --global build-size

Basic usage

Locally with npm:

# Display help
$ npm run build-size -- --help

# Parse
$ npm run build-size -- parse ./previous/**/*.js ./previous/**/*.css > previous.json
$ npm run build-size -- parse ./new/**/*.js ./new/**/*.css > new.json

# Compare
$ npm run build-size -- compare previous.json new.json

Globally:

# Display help
$ build-size --help

# Parse
$ build-size parse ./previous/**/*.js ./previous/**/*.css > previous.json
$ build-size parse ./new/**/*.js ./new/**/*.css > new.json

# Compare
$ build-size compare previous.json new.json

Example output

Parse:

$ build-size parse js/*.js css/*.css
{
  "js/app.js": 133104,
  "js/manifest.js": 1478,
  "js/vendor.js": 466292,
  "css/app.css": 24491
}

Compare:

$ build-size compare previous.json new.json
This change will increase the build size from 610.71 KB to 616.04 KB, an increase of 5.33 KB \(1%\)

File name | Previous size | New size | Change
--- | --- | --- | ---
js\/app.js | 129.98 KB | 135.32 KB | ![](https://swisnl.github.io/build-size/images/increase.svg "Increase") 5.33 KB \(4%\)
js\/manifest.js | 1.44 KB | 1.45 KB | ![](https://swisnl.github.io/build-size/images/increase.svg "Increase") 2 B \(0%\)
js\/vendor.js | 455.36 KB | 455.36 KB | 0 B \(0%\)
css\/app.css | 23.92 KB | 23.92 KB | 0 B \(0%\)

Testing

$ npm test

Contributing

Please see CONTRIBUTING and CODE_OF_CONDUCT for details.

Security

If you discover any security related issues, please email security@swis.nl instead of using the issue tracker.

Credits

Inspired by BuildSize and similar projects, such as bundlesize and Size Limit.

License

The MIT License (MIT). Please see License File for more information.

SWIS

SWIS is a web agency from Leiden, the Netherlands. We love working with open source software.

Keywords

FAQs

Last updated on 06 Apr 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc