Skip to content
PluginStats

byte-snap weekly downloads statistics

By jayf0x (2 listings) · npm · Webpack plugins

A byte counter for your build. Snap before, snap after, see the delta.

View on npm Stale · Oct 18, 2026

byte-snap has 8 recorded weekly downloads on npm, ranking #2140 of 2,391 tracked listings.

Weekly downloads
8
Official API · Oct 18, 2026
7-day growth
—
Insufficient history
30-day growth
—
Insufficient history
90-day growth
—
Insufficient history
Rank
#2140
Among tracked npm listings

About byte-snap

byte-snap

A byte counter for your build. Snap before, snap after, see the delta.

npm version minzipped size npm downloads license

Preview

Install

npm i -D byte-snap
# or
bun add -d byte-snap

Quick start

// vite.config.js
import { snapBuild } from 'byte-snap';

export default {
  plugins: [snapBuild.vite({ dir: 'dist' })],
};
$ vite build
✓ built in 1.24s

your-package
────────────
264.36 KB → 86.21 KB
saved: 178.15 KB (67.39% smaller)
files: 4 → 2
OptionDefaultDescription
dir'dist'Directory to measure

measureSize is a deprecated alias of snapBuild — same plugin, kept for back-compat.

Measure one plugin

snapPlugins shows what a single plugin (or group) changed in the final build, by rebuilding without it and diffing. Drop it into plugins: [...] where that plugin would go:

// vite.config.js
import { snapPlugins } from 'byte-snap';
import compress from 'some-compression-plugin';

export default {
  plugins: [snapPlugins([compress])],
};
$ vite build

size: plugin some-compression-plugin
────────────
1.91 KB → 338.00 B
saved: 1.58 KB (82.74% smaller)
files: 1 → 1

snapPlugins re-runs your build command once (in a child process, without the measured plugin) to produce the baseline — so the diff is byte-identical except for that plugin's effect. It defaults to npm run build, which runs your package.json build script (PM-agnostic, with local bins on PATH). Pass buildCmd for a non-standard command.

OptionDefaultDescription
buildCmd'npm run build'Build command re-run (in a child process) for the baseline.

savedPercent is always relative to the whole snapshot's beforeBytes — not to some subsystem within it. If you snapshot a whole bundle to measure one plugin's effect, the percent shown is "that many bytes off the whole bundle," which can look small even when the plugin's own footprint shrank a lot. Use savedBytes for the absolute number if that's what matters.

Custom usage

Two functions. Snapshot, do the work, diff:

import { diff, snap } from 'byte-snap';

const before = snap.path('./dist'); // file or directory (recursive)
await runYourMinifier(); // eg. codemod, image squash, anything
const after = snap.path('./dist');

diff(before, after).print();

Want the numbers? .json():

const stats = diff(before, after).json();
// {
//   beforeBytes: 1268776, afterBytes: 968496,
//   savedBytes: 300280, savedPercent: 23.67,
//   beforeFiles: 34, afterFiles: 34, fileDelta: 0
// }

Exotic use cases

Fail build if a custom plugin didn't save enough

const before = snap.path('./dist');
await runYourMinifier();

const { savedBytes } = diff(before, snap.path('./dist')).json();

// expect at least 100 bytes saved
if (savedBytes < 100) {
  console.error(`Baseline not met. Saved only ${savedBytes} bytes 🚨`);
  process.exit(1);
}

Compare gzip vs brotli on a single file

import { diff, snap } from 'byte-snap';
import { readFileSync } from 'node:fs';
import { brotliCompressSync, gzipSync } from 'node:zlib';

const raw = readFileSync('dist/index.js');
diff(snap.buffer(raw), snap.buffer(gzipSync(raw))).print();
diff(snap.buffer(raw), snap.buffer(brotliCompressSync(raw))).print();

Measure a raw string transform

diff(snap.text(source), snap.text(minify(source))).print();

API

CallReturns / does
snap.path(target)Snapshot a file or directory (recursive). Missing path → empty.
snap.text(str)Snapshot a string's UTF-8 byte length.
snap.buffer(buf)Snapshot a Buffer or ArrayBuffer.
diff(a, b)Compare two snapshots → { print(title?), json() }.
snapBuild.vite()Whole-build plugin (and .rollup, .webpack, .esbuild, …).
snapPlugins([p], o)Plugin array measuring what plugin p changed (o.buildCmd).

Each snapshot also exposes per-file detail: { files, bytes: { total, average, largest, smallest }, entries }.

License

MIT © jayF0x

Description from the npm listing.

  • size
  • bundle-size
  • bundle
  • bundler
  • filesize
  • file-size
  • diff
  • snapshot
  • measure
  • bytes
  • byte-counter
  • build
  • build-size
  • dist-size
  • output-size
  • size-check
  • size-limit
  • performance
  • minify
  • compression

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

byte-snap weekly downloads on npm, last 90 days: 8 weekly downloads as of Oct 18, 2026.byte-snapWeekly downloads on npm · Last 90 days8downloads / week7.27.47.67.888.28.48.68.8Jul 20Aug 4Aug 19Sep 3Sep 18Oct 3Oct 18downloads / weekOct 18, 2026 – Oct 18, 2026 · 1 observations · Updated Oct 18, 2026pluginstats.com
byte-snap weekly downloads on npm, last 90 days: 8 weekly downloads as of Oct 18, 2026.

7/30/90-day growth

byte-snap weekly downloads growth on npm: 7-day growth unavailable, 30-day growth unavailable, 90-day growth unavailable.byte-snapWeekly downloads growth on npm8downloads / week now7-day growthinsufficient historyInsufficient history30-day growthinsufficient historyInsufficient history90-day growthinsufficient historyInsufficient historyGrowth vs. nearest observation to each baseline date · Updated Oct 18, 2026pluginstats.com
byte-snap weekly downloads growth on npm: 7-day growth unavailable, 30-day growth unavailable, 90-day growth unavailable.

Ranking history

byte-snap npm ranking history: currently #2140 (by weekly downloads).byte-snapnpm ranking · by weekly downloads · Last 90 days#2140current rank#2138#2139#2140#2141#2142Jul 23Aug 7Aug 22Sep 6Sep 21Oct 6Oct 21rankOct 21, 2026 – Oct 21, 2026 · 1 observations · Updated Oct 18, 2026pluginstats.com
byte-snap npm ranking history: currently #2140 (by weekly downloads).

Listing placement

All npm2,389 listings · 120 pages · 1,195 shown · page 109, #15 (overall #2,175)
All npm: every listing in weekly downloads order

Listing placement

Webpack plugins257 listings · 13 pages · page 12, #12 (overall #232)
Webpack plugins: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (1)
Recent weekly downloads observations for byte-snap
Date (UTC)Weekly downloadsChange vs. previous
8—

Similar npm Webpack plugins plugins

All 20 byte-snap alternatives

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/byte-snap. First seen Oct 21, 2026; last successful collection Oct 21, 2026. See the methodology.