All Projects → egoist → Package Size

egoist / Package Size

Licence: mit
Get the bundle size of an npm package.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Package Size

Ostap
CLI tool that fast checks if your bundle contains multiple versions of the same package, only by looking in package.json.
Stars: ✭ 117 (-54.47%)
Mutual labels:  webpack, bundle
Whybundled
Answers the question – Why the hell is this module in a bundle?
Stars: ✭ 477 (+85.6%)
Mutual labels:  webpack, bundle
Webpack.js.org
Repository for webpack documentation and more!
Stars: ✭ 2,049 (+697.28%)
Mutual labels:  webpack, bundle
Poi
⚡A zero-config bundler for JavaScript applications.
Stars: ✭ 5,291 (+1958.75%)
Mutual labels:  webpack, bundle
Webpack Bundle
Bundle to Integrate Webpack into Symfony
Stars: ✭ 124 (-51.75%)
Mutual labels:  webpack, bundle
Webpack Bundle Analyzer
Webpack plugin and CLI utility that represents bundle content as convenient interactive zoomable treemap
Stars: ✭ 11,472 (+4363.81%)
Mutual labels:  webpack, bundle
Webpack
简单易懂的webpack入门教程
Stars: ✭ 175 (-31.91%)
Mutual labels:  webpack, bundle
react-native-ci-tools
Change application bundle name and ID on the fly (build time) for both Android and IOS
Stars: ✭ 30 (-88.33%)
Mutual labels:  bundle
acl-bundle
Integrates the ACL Security component into Symfony applications.
Stars: ✭ 91 (-64.59%)
Mutual labels:  bundle
LiipMultiplexBundle
[DEPRECATED] Symfony2 controller that allows calling multiple URL's in one request as well as JSON-ifying any controller
Stars: ✭ 12 (-95.33%)
Mutual labels:  bundle
ParamConverterBundle
This bundle provides additional param converters for Symfony.
Stars: ✭ 16 (-93.77%)
Mutual labels:  bundle
AutoFormBundle
Automate Symfony form building
Stars: ✭ 68 (-73.54%)
Mutual labels:  bundle
SonataAutoConfigureBundle
Symfony Bundle that auto configures Sonata Admin.
Stars: ✭ 16 (-93.77%)
Mutual labels:  bundle
bem-sdk
BEM SDK packages
Stars: ✭ 83 (-67.7%)
Mutual labels:  bundle
Shopify Theme Lab
Shopify theme development environment using Liquid, Vue and Tailwind CSS 🧪
Stars: ✭ 250 (-2.72%)
Mutual labels:  webpack
mpx-es-check
Checks the version of ES in JavaScript files with simple shell commands
Stars: ✭ 15 (-94.16%)
Mutual labels:  bundle
Vue Home
🏠 A simple project(Vue Community SPA) which bases on vue+vue-cli+vue-router+axios+ scss.
Stars: ✭ 256 (-0.39%)
Mutual labels:  webpack
mailchimp-bundle
MailChimp integration with Symfony and MailChimp API V3
Stars: ✭ 40 (-84.44%)
Mutual labels:  bundle
TableBundle
Symfony Bundle for easy pagination and filtering
Stars: ✭ 24 (-90.66%)
Mutual labels:  bundle
BeelabUserBundle
👥 Simple user management for Symfony.
Stars: ✭ 17 (-93.39%)
Mutual labels:  bundle

package-size

NPM version NPM downloads Build Status donate

preview

How does this work?

  1. Install the packages with yarn or npm in a temp directory
  2. Bundle the packages with webpack and get the bundle size
  3. Show you the bundle size and cache it by package version

Install

yarn global add package-size

Usage

The package is bundled with Webpack.

# get the size of vue bundle
package-size vue

# get the size of react+react-dom bundle
package-size react,react-dom

# get the size of vue react+react-dom preact bundles
package-size vue react,react-dom preact

# get the size of react+react-dom without using the cache
package-size react,react-dom --no-cache

# get the size of file in current working directory
package-size ./dist/index.js
# or a package in current working directory, explictly using `--cwd` flag
package-size vue --cwd

# or event multiple versions for the same package!
package-size [email protected] [email protected] [email protected]

# save results to file system in JSON format
# defaults to ./package-size-output.json
package-size cherow --output
# or custom path
package-size cherow --output stats.json

# analyze bundle with webpack-bundle-analyzer
package-size cherow --analyze
# analyze bundle with webpack-bundle-analyzer on a different port
package-size cherow --analyze --port 9000

API

const getSizes = require('package-size')

getSizes('react,react-dom', options)
  .then(data => {
    console.log(data)
    //=>
    {
      name: 'react,react-dom',
      size: 12023, // in bytes
      minified: 2342,
      gzipped: 534,
      versionedName: '[email protected],[email protected]'
    }
  })

options

sort

Type: boolean
Default: false

Sort packages in size (from small to large).

cwd

Type: boolean
Default: false

Resolve modules in current working directory instead of a cache folder. Relative path will set cwd to true by default.

externals

Type: string or Array<string|RegExp>
Default: undefined

The package to exclude from bundled file, for example, to get the bundle size of styled-jsx/style we need to exclude react:

package-size styled-jsx/style --externals react

Note that if some item in externals is provided as string, it will be wrapped in a regular expression. For example: react is treated as /^react$/

cache

Type: boolean
Default: true

If cache is set to false, then package-size will not use cached build sizes. To use this from the CLI, pass --no-cache as an argument.

target

Type: string
Default: browser Values: browser node

Build target. In node target, all node_modules will be excluded and output format is set to CommonJS.

registry

Type: string
Default: undefined

npm registry to install the package from. By default it uses the default npm registry.

resolve

Type: string string[]
Default: undefined

Extra folders to resolve local node_modules from.

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Author

package-size © EGOIST, Released under the MIT License.
Authored and maintained by EGOIST with help from contributors (list).

egoist.moe · GitHub @egoist · Twitter @_egoistlily

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].