Git Product home page Git Product logo

bundle-size's Introduction

codecov

bundle-size

Show bundle file size of npm packages

Installation

$ npm install bundle-size

Usage

in CLI

$ 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:

bundle-size react
bundle-size react --env development
bundle-size react -e development -e production

in Node.js module

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

bundle-size's People

Contributors

danielruf avatar dependabot[bot] avatar greenkeeper[bot] avatar greenkeeperio-bot avatar mkwtys avatar renovate-bot avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

ibrahimjelliti

bundle-size's Issues

Binary file name is 'cli'

Hi,

When i installed it globally, (with nvm)
I suppose that bin file name is bundle-size, but the file name is cli now.
I attached my bash history.

2012MidMPR:~$ npm i -g bundle-size
/Users/ssohjiro/.nvm/versions/node/v4.4.4/bin/cli -> /Users/ssohjiro/.nvm/versions/node/v4.4.4/lib/node_modules/bundle-size/bin/cli.js
[email protected] /Users/ssohjiro/.nvm/versions/node/v4.4.4/lib/node_modules/bundle-size
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])

2012MidMPR:~$ npmdle-size
-bash: npmdle-size: command not found

2012MidMPR:~$ cli

2012MidMPR:~$ cli --help

Show bundle file size of npm packages

Usage
  cli [packages] [options]

Options
  -e, --env         set NODE_ENV
  -h, --help        show help
  -r, --reporter    output style
  -v, --version     print version

2012MidMPR:~$

Thanks for good useful module!

ci

.travis.yml

test failed

because difference of node version 4/5?

      AssertionError: [ { modules: [ './test/noop' ], bundle: 618, min: 603, gzip: 500 },
  { modules: [ './test/noop' ],
    bundle: 618,
    min: 60 deepEqual [ { modules: [ './test/noop' ], bundle: 609, min: 594, gzip: 484 },
  { modules: [ './test/noop' ],
    bundle: 609,
    min: 59
      + expected - actual

       [
         {
      -    "bundle": 618
      -    "gzip": 500
      -    "min": 603
      +    "bundle": 609
      +    "gzip": 484
      +    "min": 594
           "modules": [
             "./test/noop"
           ]
         }
         {
      -    "bundle": 618
      +    "bundle": 609
           "env": "development"
      -    "gzip": 500
      -    "min": 603
      +    "gzip": 484
      +    "min": 594
           "modules": [
             "./test/noop"
           ]
         }
         {
      -    "bundle": 618
      +    "bundle": 609
           "env": "production"
      -    "gzip": 500
      -    "min": 603
      +    "gzip": 484
      +    "min": 594
           "modules": [
             "./test/noop"
           ]
         }

env option

bundle-size --env production
bundle-size --env [development, production]

ref: #9

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/nodejs.yml
  • actions/checkout v4
  • actions/setup-node v4
  • codecov/codecov-action v4
npm
package.json
  • browserify 17.0.0
  • cli-table3 0.6.5
  • envify 4.1.0
  • minimist 1.2.8
  • ora 8.0.1
  • pretty-bytes 6.1.1
  • uglify-js 3.18.0
  • jest 29.7.0

  • Check this box to trigger a request for Renovate to run again on this repository

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: undefined. Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.

cli

bundle-size react
bundle-size [react, react-dom]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.