# buildsize-cli

> file size check for cli

Latest version **1.4.1** (published 2024-06-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install buildsize-cli
pnpm add buildsize-cli
yarn add buildsize-cli
bun add buildsize-cli
```

Provides the command `buildsize-cli`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.1 |
| Published | 2024-06-19 |
| First published | 2020-05-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 10 |
| Unpacked size | 2.2 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Scott Sullivan |
| Maintainers | ssulivan11 |

## Links

- npm: https://www.npmjs.com/package/buildsize-cli
- Repository: https://github.com/ssulivan11/buildsize-cli
- Homepage: https://github.com/ssulivan11/buildsize-cli#readme
- Issues: https://github.com/ssulivan11/buildsize-cli/issues
- npm.io page: https://npm.io/package/buildsize-cli

## Dependencies (10)

- [bytes](https://npm.io/package/bytes.md) ^3.1.0
- [chalk](https://npm.io/package/chalk.md) ^4.0.0
- [shelljs](https://npm.io/package/shelljs.md) ^0.8.4
- [prettier](https://npm.io/package/prettier.md) ^2.0.5
- [commander](https://npm.io/package/commander.md) ^5.1.0
- [gzip-size](https://npm.io/package/gzip-size.md) ^5.1.1
- [colors-cli](https://npm.io/package/colors-cli.md) ^1.0.32
- [node-emoji](https://npm.io/package/node-emoji.md) ^1.11.0
- [brotli-size](https://npm.io/package/brotli-size.md) ^4.0.0
- [cosmiconfig](https://npm.io/package/cosmiconfig.md) ^6.0.0

## Recent versions

- 1.4.1 (latest) — 2024-06-19
- 1.4.0 — 2024-01-08
- 1.3.0 — 2023-07-02
- 1.2.1 — 2023-02-28
- 1.2.0 — 2023-02-28
- 1.1.2 — 2021-08-10
- 1.1.1 — 2021-08-10
- 1.1.0 — 2021-08-10
- 1.0.6 — 2020-06-11
- 1.0.5 — 2020-06-01
- 1.0.4 — 2020-06-01
- 1.0.3 — 2020-05-31
- 1.0.2 — 2020-05-31
- 1.0.1 — 2020-05-31
- 1.0.0 — 2020-05-31

## README

# buildsize-cli 🏗️

define file sizes, error message and the last time it was changed

## supported naming

- .buildsizerc.js
- buildsize.config.js

## flag for path

```shell
buildsize-cli --config folder/path
```

## usage

```js
module.exports = {
  lastUpdated: 'Fri May 29 2020 12:00:00 GMT-0500 (Central Daylight Time)', // optional timestamp
  failMessage: 'Please fix, split, or set to warn.', // optional message to display on failed check
  failOnMissingBundles: true, // optional boolean to decalre if job should fail if any files are missing
  files: [
    {
      path: '__mocks__/5kb.mock.js', // build file path to check against
      maxSize: '6kB', // optional max file size validation
      minSize: '1kB', // optional min file size validation
      compression: 'gzip', // optional compression type, gzip | brotli
      warnOnly: true, // optional choice to not fail the check
      lastSize: true, // optionally display percentage difference of current size and last set max size
      externals: {
        // optional sizes are added and removed from maxSize for readabliity
        'package-one': '1kB'
      }
    }
  ]
};
```

### valid example

![](https://i.imgur.com/OhYdEHc.png)

### invalid example

![](https://i.imgur.com/qn9c8Lq.png)

### references

this all started on the basis of the amazing [bundlesize](https://github.com/siddharthkp/bundlesize) project but is centered around unique customizations

---
_Source: https://npm.io/package/buildsize-cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
