npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@mrkt_frwd/leaf

v0.1.1

Published

Leaf — take a self-contained HTML page apart into editable CSS and JS, put it back, and prove it is the same file.

Readme

@mrkt_frwd/leaf

Take a self-contained HTML page apart into editable CSS and JS, put it back, and prove it is the same bytes.

npx @mrkt_frwd/leaf unpack page.html --output-dir ./out
npx @mrkt_frwd/leaf pack ./out --out page.html

What it is for

Single-file pages are wonderful to ship and miserable to edit — one 40 KB file with the stylesheet, the shaders and the app logic in it. Leaf splits that into real files you can open in an editor, and puts it back together byte for byte.

The claim, and the evidence for it

Run against a real 22,891-byte page:

$ npx @mrkt_frwd/leaf unpack engines/job.html --output-dir ./out
unpacked job.html → ./out
sha256 7d3437b28d34…  4 part(s)
  parts/00-script-importmap.json     104 B
  parts/01-style.css              7970 B
  parts/02-script.js              2128 B
  parts/03-script-module.js       3671 B

$ npx @mrkt_frwd/leaf pack ./out --out rebuilt.html
packed → rebuilt.html
sha256 7d3437b28d34…  22891 B
identical to the source it was unpacked from

Same digest on both ends, confirmed independently with shasum and cmp.

Why byte-exact and not "close enough"

A round trip that is nearly right is the worst available outcome. It returns a page that still loads, still looks plausible, and has quietly lost a newline inside a shader or a tab inside a template literal. You find out weeks later.

So Leaf does not re-serialise a parse tree. It records where each block sat and what surrounded it, edits nothing, and reassembles from the original shell. And it reports the digest rather than a success message — when the bytes do not match, it says so instead of claiming victory.

This replaced twenty-one hand-written repack scripts that each failed the same way: nearly.

Commands

leaf unpack <page.html> --output-dir <dir>   take it apart
leaf pack <dir> [--out <page.html>]          put it back, report the digest
leaf check <page.html>                       is it genuinely self-contained?

check answers a different question worth asking: does this page actually fetch nothing from another origin, or does it only look like it?

Requirements

Node 18+. No dependencies.

MIT © Joe Asare. Built at Joe Asare Studio.