New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@codechecks/build-size-watcher

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@codechecks/build-size-watcher

Keep your build size in check and detect when it gets too big

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
43
decreased by-44.87%
Maintainers
1
Weekly downloads
 
Created
Source

codechecks.io

Build Size Watcher

Keep your build size in check and detect when it gets too big

Build Status Software License

Install

npm add --save-dev @codechecks/build-size-watcher

or

yarn add --dev @codechecks/build-size-watcher

Usage

Add to your codechecks.yml file:

checks:
  - name: build-size-watcher
    options:
      files:
        - path: "./build/static/js/*.js"
          maxSize: 1MB
        - path: "./build/static/css/*.css"
        - path: "./build/static/images/*.jpg"
  # ...

With each pull request you will get a summary like Change +3 KB(+1%) Total 300KB and detailed size breakdown for each path in check's details.

API

buildSizeWatcher(options: BuildSizeWatcherOptions): Promise<void>

BuildSizeWatcherOptions
interface BuildSizeWatcherOptions {
  gzip?: boolean; // defaults to true
  files: {
    path: string; // supports globs
    maxSize?: number | string;
  }[];
  name?: string; // defaults to "Build Size"
}
gzip

optional boolean

Defaults: true

Specify if files should be gzipped before size calculation

files
interface FileDescription {
  path: string; // supports glob
  maxSize?: number | string;
}

List of files to track.

files.path

string

Path specifying files to bundle together while calculating size. Supports globs. It's great when you have to deal with checksums in file names: ex. "./build/static/js/*.js"

files.maxSize

optional number|string

Provide the maximum size of all files matched by files.path. It can be a number in bytes or a string like "1KB" or "1MB". When max size is reached the whole check will report failure.

name

optional string

Defaults: Build Size

Specify the name for check. Might be useful when you track multi

Contributing

All contributions are welcomed. Read more in CONTRIBUTING.md

Licence

MIT @ codechecks.io

Keywords

FAQs

Package last updated on 21 May 2019

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc