0.1.0 • Published 5 years ago

bpstats v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

Bundlephobia Stats CLI

Outputs stats from Bundlephobia to the command line (this is a cli wrapper around package-build-stats). It can also be used to compute stats for local or unpublished packages.

Use it with npx

npx bpstats <package>
npx bpstats react
npx bpstats react@16.8.0

Or provide a path to a local package (must have a package.json with at least name, version, and main fields):

npx bpstats ~/path/to/package

Or when in the local package directory:

npx bpstats $PWD

Use it as part of the build process for packages

npm install --save-dev bpstats

To output package stats as part of the build process add it to the build script in package.json:

{
  "scripts": {
    "build": "... && bpstats $PWD"
  }
}

Example output for @stitches/react

% npx bpstats @stitches/react
installPath /tmp/tmp-build/packages/build-@stitchesreact-usd
{
  dependencyCount: 4,
  hasJSNext: false,
  hasJSModule: 'dist/react.esm.js',
  hasSideEffects: true,
  peerDependencies: [ 'react' ],
  assets: [
    { name: 'main', type: 'js', size: 29492, gzip: 8471, parse: null }
  ],
  dependencySizes: [
    { name: '@stitches/react', approximateSize: 8960 },
    { name: '@stitches/core', approximateSize: 38688 }
  ],
  size: 29492,
  gzip: 8471,
  parse: null
}
0.1.0

5 years ago