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

@kashscript/lexicons

v0.1.1

Published

Zero-dependency lexicon framework — envelope, schema DSL, registry, validator. Agnostic core; domain content ships as opt-in extensions.

Readme

@kashscript/lexicons

Zero-dependency lexicon framework — envelope, schema DSL, registry, validator. Domain-agnostic core; vocabularies ship as opt-in extensions.

bun add @kashscript/lexicons

A lexicon is the Kash equivalent of an AT-Protocol record schema: a versioned, NSID-addressed JSON shape that describes what valid kash.* records look like. This package gives you the primitives to define, register, and validate lexicons — but ships zero domain content out of the box. The domain extensions (social, trade, zkp) are explicit subpath imports.


What's in the box

| Subpath | Purpose | |----------------------------------------|------------------------------------------------------| | @kashscript/lexicons | Default — re-exports envelope, schema, registry, engine | | @kashscript/lexicons/envelope | Record envelope shape + wrap() / unwrap() | | @kashscript/lexicons/schema | Schema DSL — string(), object(), union(), etc. | | @kashscript/lexicons/registry | LexiconRegistry — register, lookup, version-resolve | | @kashscript/lexicons/engine | validate(envelope, registry) — pure-TS validator | | @kashscript/lexicons/json-schema | Export lexicons as JSON Schema (draft 2020-12) | | @kashscript/lexicons/semver | Strict semver for lexicon evolution | | @kashscript/lexicons/extensions/social | The kash.social.* vocabulary | | @kashscript/lexicons/extensions/trade | The kash.trade.* vocabulary | | @kashscript/lexicons/extensions/zkp | The kash.zkp.* vocabulary |


Quickstart

import { object, string, number } from "@kashscript/lexicons/schema";
import { LexiconRegistry } from "@kashscript/lexicons/registry";
import { validate } from "@kashscript/lexicons/engine";

// 1. Define a lexicon
const myPost = {
  nsid: "com.example.post",
  version: "1.0.0",
  shape: object({
    text:      string({ maxLength: 280 }),
    createdAt: number(),
  }),
};

// 2. Register it
const registry = new LexiconRegistry();
registry.register(myPost);

// 3. Validate a record
const result = validate(
  {
    $type:   "com.example.post",
    $version:"1.0.0",
    text:    "hello world",
    createdAt: Date.now(),
  },
  registry,
);
if (!result.ok) console.error(result.errors);

License

Apache-2.0. Also covered by SSLA v1.0 Schedule A (Permissive). See LICENSE.