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

@jaxxstorm/hujsonkit

v0.4.0

Published

TypeScript/JavaScript HuJSON toolkit compatible with tailscale/hujson semantics.

Readme

hujsonkit

hujsonkit is a TypeScript/JavaScript HuJSON library built to track the practical behavior of github.com/tailscale/hujson.

What it does

  • Parses HuJSON with comments and trailing commas.
  • Preserves the original bytes for parsed values that are packed without mutation.
  • Exposes AST-first helpers for parsing, packing, standardizing, minimizing, formatting, and applying JSON Patch operations.
  • Publishes from the repository root while keeping the implementation in js/ts and shared fixtures at the repository root.

Usage

const { parse, pack, standardize, format, patch } = require("hujsonkit");

const value = parse('{\n  // comment\n  "name": "demo",\n}\n');

console.log(pack(value));
console.log(standardize(value));
console.log(format(value));

const patched = patch(value, [
  { op: "add", path: "/enabled", value: true }
]);

console.log(pack(patched));

Development

  • Run npm run verify before opening a pull request. It covers unit tests, npm package contents, published-package consumer checks, and direct repository consumer checks.
  • The pull request workflow runs the same npm run verify contract on GitHub Actions for pull requests against main.
  • Direct repository installs rely on the existing prepare lifecycle to build dist/, so dist/ remains generated output rather than a committed source artifact.

Release

Releases are prepared locally and published by GitHub Actions after a matching version tag is pushed. The same tag-triggered workflow publishes the package to npm and creates the matching GitHub Release.

  1. Start from main with a clean working tree.

  2. Prepare the release with one semver increment or an explicit version:

    npm run release:prepare -- patch
    npm run release:prepare -- minor
    npm run release:prepare -- major
    npm run release:prepare -- 1.2.3
  3. Review the generated release commit and annotated tag:

    git show --stat HEAD
    git tag --list "v*" --sort=-version:refname | head
  4. Push the release commit and tag together:

    git push origin HEAD v1.2.3

Pushing the v<version> tag starts the publish workflow. The workflow installs dependencies, verifies that the tag exactly matches the root package.json version, runs npm run verify, publishes to npm with npm trusted publishing through GitHub Actions OIDC, and creates the matching GitHub Release with generated release notes. If the tag and package version differ, the workflow fails before npm publish and before GitHub Release creation.

The package must be configured on npmjs.com with a trusted publisher for this repository and the .github/workflows/publish.yml workflow. No NPM_TOKEN repository secret is used for publication. GitHub Release creation uses the workflow's repository contents: write permission through the default GitHub token.

API differences from tailscale/hujson

  • The library exposes pure functions such as parse, pack, standardize, minimize, format, and patch instead of Go-style methods that mutate a receiver in place.
  • format produces deterministic HuJSON output that aims to match upstream tailscale/hujson.Format bytes for supported inputs, including comments, spacing, duplicate object members, and the trailing newline used by formatter-dependent hashes.
  • patch applies RFC 6902 operations against the standardized JSON model and returns a fresh HuJSON AST. Comment placement is not preserved across patch operations in this bootstrap.

The unchanged parse/pack round-trip remains byte-preserving, which is the main compatibility guarantee needed to safely read and write HuJSON inputs before transformation.