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

@tokens-studio/schema-validation

v0.1.0

Published

Stateless validator for the TokenScript schema language. Typed schemas per kind plus URL and version utilities. Source of truth shared with the Go and Ruby implementations under tokenscript/schema-validation/.

Readme

@tokens-studio/schema-validation

TypeScript implementation of the TokenScript schema-validation library. See ../README.md for the cross-language overview and ../SCHEMA-LANGUAGE.md for the field reference.

Usage

npm install
npm test          # vitest
npm run build     # tsup → dist/
npm run typecheck # tsc --noEmit

Public API

The library uses per-kind namespace exports so that helper types (Schema, Property, ScriptBlock, etc.) can have the same name across kinds without colliding:

import {
  Token, Color, Fn, Unit, Constants,
} from "@tokens-studio/schema-validation";

const tokenSpec     = Token.parseTokenSpec(jsonFromRegistry);
const colorSpec     = Color.parseColorSpec(jsonFromRegistry);
const fnSpec        = Fn.parseFunctionSpec(jsonFromRegistry);
const unitSpec      = Unit.parseUnitSpec(jsonFromRegistry);
const constantsSpec = Constants.parseConstantsSpec(jsonFromRegistry);

// Safe variants:
const result = Token.safeParseTokenSpec(jsonFromRegistry);
if (!result.success) console.error(result.error.issues);

The function-kind namespace is exported as Fn, not Function, because Function is a global JavaScript constructor and a TypeScript built-in type — re-exporting under that name would shadow both.

URL and version utilities are exported as flat helpers (no namespace) because they have no per-kind variant: parseSchemaUri, buildSchemaUri, compareVersions, parseVersionString, etc.

Stack

  • zod ^4 — runtime schema validation. Chosen because the Nuxt frontend in this repo already depends on zod; using the same library avoids adding a second runtime validator to the bundle.
  • vitest — test runner.
  • tsup — bundler.
  • typescript ^5.9 — type-checker (no emit).

Tests

npm test

Runs the per-kind unit tests under tests/<kind>.test.ts plus the shared cross-language fixture corpus at ../fixtures/v1/ via tests/fixtures.test.ts.