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

@formancy/spec

v0.2.0

Published

The formancy form schema specification: types, JSON Schema, canonical serialisation and diffing.

Readme

@formancy/spec

The formancy form schema: its TypeScript types, its JSON Schema, a validator, a canonical content hash, and a diff that classifies what a change costs the data already collected.

This package has no dependencies on any framework, on Node or on the DOM. The same build runs in a browser, in a server and in a build script.

Two load-bearing decisions

The canonical hash is the version's identity. schemaHash(schema) is a SHA-256 over a canonical serialisation, so two documents differing only in key order are the same version. canonicalize refuses undefined, NaN and Infinity rather than letting JSON.stringify drop or coerce them — a dropped field would make two different schemas share a hash, which would quietly break the tamper evidence every submission relies on.

diffSchemas classifies by cost, over data paths. Every change is compatible, lossy or breaking, and the walk follows data paths rather than the field list: a change inside a group or a repeater template is seen, moving a field between wizard pages is no change at all, and moving one into a group is a removal plus an addition — because the submission shape really did change. A key that changes without a declared renamedFrom is reported as remove-plus-add rather than guessed at; guessing wrong silently moves one field's answers into another field.

Use

import { schemaHash, diffSchemas, modelDataPaths } from '@formancy/spec'
import { validateSchema } from '@formancy/spec/validate'

const result = validateSchema(document)
if (!result.valid) {
  for (const error of result.errors) console.log(error.path, error.message)
}

for (const change of diffSchemas(published, draft)) {
  console.log(change.severity, change.kind, change.path)
}

validateSchema lives behind its own subpath because it pulls in ajv, and the renderers import this package only for types and hashing. The validator itself is precompiled at authoring time — compiling at runtime would reach for new Function, which throws under the strict no-unsafe-eval policy the browser-embedded builder runs under.

Docs: apps/docs (Concepts → The schema).