Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

size-limit

Package Overview
Dependencies
36
Maintainers
1
Versions
174
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    size-limit

CLI tool for Size Limit


Version published
Maintainers
1
Created

Package description

What is size-limit?

Size Limit is a performance monitoring tool for JavaScript projects. It helps you keep your project within a specific size limit by analyzing the size of your JavaScript bundles and providing warnings when the size exceeds the specified limit.

What are size-limit's main functionalities?

Bundle Size Analysis

This feature allows you to specify the path to your JavaScript bundle and set a size limit. Size Limit will analyze the bundle and ensure it does not exceed the specified limit.

module.exports = [
  {
    path: 'dist/bundle.js',
    limit: '500 KB'
  }
];

Custom Configurations

You can customize the analysis by enabling gzip compression or disabling the running of the bundle. This provides more flexibility in how you measure the size of your bundles.

module.exports = [
  {
    path: 'dist/bundle.js',
    limit: '500 KB',
    gzip: true,
    running: false
  }
];

Multiple Bundles

Size Limit supports analyzing multiple bundles in a single configuration. This is useful for projects with multiple entry points or output files.

module.exports = [
  {
    path: 'dist/bundle1.js',
    limit: '300 KB'
  },
  {
    path: 'dist/bundle2.js',
    limit: '200 KB'
  }
];

Other packages similar to size-limit

Changelog

Source

11.1.1

  • Fixed Windows support (by @aryaemami59).

Readme

Source

Size Limit CLI Tool

Size Limit logo by Anton Lovchikov

Size Limit is a performance budget tool for JavaScript. It checks every commit on CI, calculates the real cost of your JS for end-users and throws an error if the cost exceeds the limit.

  • ES modules and tree-shaking support.
  • Add Size Limit to Travis CI, Circle CI, GitHub Actions or another CI system to know if a pull request adds a massive dependency.
  • Modular to fit different use cases: big JS applications that use their own bundler or small npm libraries with many files.
  • Can calculate the time it would take a browser to download and execute your JS. Time is a much more accurate and understandable metric compared to the size in bytes.
  • Calculations include all dependencies and polyfills used in your JS.
Size Limit CLI

With GitHub action Size Limit will post bundle size changes as a comment in pull request discussion.

Size Limit comment in pull request about bundle size changes

See full docs on GitHub.

Keywords

FAQs

Last updated on 16 Mar 2024

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