summaryrefslogtreecommitdiffstats
path: root/scripts/size.js
blob: 7583e86a92084952af9170ed420405971fd369ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { gzipSync } from "bun";

const files = [
  "dist/cepis-autofill.js",
  "dist/cepis-autofill.min.js",
  "dist/cepis-autofill.esm.js",
];

for (const path of files) {
  const bytes = await Bun.file(path).bytes();
  const gzipped = gzipSync(bytes).length;
  console.log(
    `${path.padEnd(28)} ${String(bytes.length).padStart(6)} B  ${String(gzipped).padStart(5)} B gzipped`,
  );
}