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

@chichurita/shorn

v0.2.0

Published

One-line drop-in binary serialization for your existing Zod, Valibot, or ArkType schema

Readme

shorn

shorn turns a validation schema you already have into compact binary serialization. Pass a Zod, Valibot, or ArkType schema to encode and get bytes back — no schema language, no code generation, no second source of truth.

Field names and type tags stay out of the payload because the schema already provides them. The saving comes from the schema, not a compressor, so it costs no CPU: up to 6.2× faster to encode and 13.5× faster to decode than JSON bytes.

shorn is experimental alpha and runs in Node, Bun, Deno, browsers, and workers.

Installation

npm install @chichurita/shorn zod

ESM only, Node 20 or newer. require("@chichurita/shorn") works from Node 20.19 and 22.12 on; before that a CommonJS caller needs await import("@chichurita/shorn").

Encode a value

import { z } from "zod";
import { decode, encode } from "@chichurita/shorn";

const Person = z.object({
  name: z.string(),
  age: z.int().nonnegative(),
  sex: z.enum(["M", "F", "X"]),
});

const person = { name: "Grace", age: 45, sex: "F" } as const;

const bytes = encode(Person, person); // Uint8Array(8)
const back = decode(Person, bytes);   // typed and validated

The same record is 35 bytes of minified JSON. Validation runs on encode and again on decode, and equivalent schemas across validators produce the same bytes.

Store and queue safely

Bare payloads carry no wire identifier. Add a fingerprint to anything stored, queued, or read across deployments:

import { compile, fingerprinted } from "@chichurita/shorn";

const PersonWire = fingerprinted(compile(Person), { bytes: 4 });

const bytes = PersonWire.encode(person); // 4-byte fingerprint + payload
PersonWire.decode(bytes);                // rejects a different wire shape

A fingerprint identifies wire structure, not refinements. Keep old codecs while old payloads exist.

Use another validator

Pass a Zod 4.2+ schema or an ArkType 2.1.28+ type directly. For Valibot 1.x, pass toStandardJsonSchema(schema) as the trailing argument. shorn reads validation through Standard Schema and structure through Standard JSON Schema.

Scope

shorn covers strings, booleans, integers, numbers, literals, enums, nullable values, arrays, tuples, records, unions — discriminated, or with no two branches sharing a JSON type — recursive schemas, dynamic values (z.any()), and objects — closed or open, with optional fields. It does not support unions whose branches overlap, streaming, or automatic schema evolution. Date, bigint, Map, and Set need an explicit wire representation.

Documentation

See getting started and the API reference for the complete workflow. The docs also cover the byte layout, supported types, rejected shapes, fingerprinting, and performance.

MIT licensed.