From fe5ee597733fa9a1ad803ae45e020e4308680391 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 16 Mar 2022 22:52:21 +0100 Subject: [PATCH] finalize --- .changeset/rich-files-smash.md | 5 ++++ README.md | 45 ++++++++++++++++++++++++++++++++++ src/utils.ts | 2 +- 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 .changeset/rich-files-smash.md create mode 100644 README.md diff --git a/.changeset/rich-files-smash.md b/.changeset/rich-files-smash.md new file mode 100644 index 0000000..016c642 --- /dev/null +++ b/.changeset/rich-files-smash.md @@ -0,0 +1,5 @@ +--- +"@beequeue/sizer": minor +--- + +Initial release! diff --git a/README.md b/README.md new file mode 100644 index 0000000..2d0e067 --- /dev/null +++ b/README.md @@ -0,0 +1,45 @@ +# Sizer CLI + +## Installation + +Install it from npm: + +``` +npm i -g @beequeue/sizer +``` + +Or (not recommended) download one of the binaries in [the Releases tab](https://github.com/BeeeQueue/sizer/releases). + +## Usage + +``` +Usage: sizer [options] + +Arguments: + glob File path glob to analyze + +Options: + -V, --version output the version number + -s, --sort Change how files are sorted in the output (choices: "size-asc", "size-desc", "name-asc", + "name-desc", default: "size-desc") + -B, --brotli Compress using Brotli (slow!) + --json Output in JSON format + -h, --help display help for command +``` + +
+Example output + +``` +❯ sizer dist/**/*.js +Path Size Gzip Diff% +---- ---- ---- ----- +dist/assets/vendor.a06e18d4.js 144.79KB 47.58KB -67% +dist/assets/index.2143eba7.js 18.17KB 7.79KB -57% +dist/sw.js 16.24KB 5.6KB -66% +dist/assets/virtual_pwa-register.69ec1145.js 5.81KB 2.42KB -58% +----- ------ ------ ---- +Total 185KB 63.38KB -66% +``` + +
diff --git a/src/utils.ts b/src/utils.ts index 19d3ba5..fccd04e 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -19,7 +19,7 @@ export const printRows = >(rows: Array `${accum}\n${row - .map((column, i) => column.padEnd(maxColWidths[i] + 1, " ")) + .map((column, i) => column.padEnd(maxColWidths[i] + 2, " ")) .join("")}`, "", )