Skip to content

Commit

Permalink
finalize
Browse files Browse the repository at this point in the history
  • Loading branch information
beeequeue committed Mar 16, 2022
1 parent 0863cf8 commit fe5ee59
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/rich-files-smash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@beequeue/sizer": minor
---

Initial release!
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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] <glob>
Arguments:
glob File path glob to analyze
Options:
-V, --version output the version number
-s, --sort <type> 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
```

<details>
<summary>Example output</summary>

```
❯ 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%
```

</details>
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const printRows = <Tuple extends ReadonlyArray<string>>(rows: Array<Tuple
.reduce(
(accum, row) =>
`${accum}\n${row
.map((column, i) => column.padEnd(maxColWidths[i] + 1, " "))
.map((column, i) => column.padEnd(maxColWidths[i] + 2, " "))
.join("")}`,
"",
)
Expand Down

0 comments on commit fe5ee59

Please sign in to comment.