Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

simple-file-size

cbbfcd16MIT1.0.6TypeScript support: included

a super simple cli for file-size limit

oclif, maxSize, filesize, limition, gzip, compression

readme

simple-file-size

a super simple cli for file-size limit

oclif Version Downloads/week Build Status License

Usage

$ npm install --save-dev simple-file-size

Super simple, Just two steps

  • add filesize in package.json
{
  "name": "simple-file-size",
  "description": "a super simple cli for file-size limit",
  "version": "1.0.0",
  "filesize": [
    {
      "maxSize": "1kb",
      "path": "./test/index.test.ts", 
      "level": 9
    }
  ]
}
  • maxSize must be a string like '1kb', '1mb', '10244'
  • path, as you know, like './index.ts', path.resolve(__dirname, './a.js')
  • level is optional, default is 9
  • add script in package.json
{
  "scripts": {
    "filesize": "npx simple-file-size"
  }
}

or download the simple-file-size in devDepencies, and then:

"scripts": {
    "filesize": "filesize"
  }
  • demos

demo

Commands

It works well now, maybe we need more in future, not now