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

@colspec/core

v0.1.1

Published

JSON contract schema, validation and function registries for dynamic TanStack Table definitions.

Readme

@colspec/core

The contract at the center of colspec: a JSON format for TanStack Table definitions, with validation and the registry types that connect names in the JSON to functions in your code.

It has no dependency on React, TanStack Table or any database, so it runs in the browser and on the server.

npm install @colspec/core

Validate a contract

import { validateContract } from "@colspec/core";

const result = validateContract(json);

if (result.ok) {
  result.value; // a typed TableContract
} else {
  result.diagnostics; // [{ code, severity, path, message }]
}

A contract looks like this. Property names follow TanStack Table v9; anything executable is a named reference.

{
  "schemaVersion": "1.0",
  "tableId": "inventory.products",
  "revision": 4,
  "columns": [
    {
      "id": "name",
      "accessorKey": "name",
      "header": "Name",
      "sortFn": "alphanumeric"
    },
    {
      "id": "status",
      "accessorKey": "status",
      "cell": { "ref": "inventory.statusBadge" }
    }
  ],
  "defaults": { "pagination": { "pageSize": 25 } },
  "mode": { "sorting": "client", "filtering": "client", "pagination": "server" }
}

Validation covers structure, schema version, duplicate column ids, defaults that name unknown columns, and execution modes that don't work together. Add your own checks with validateContract(json, { rules }).

Compose registries

import { composeRegistries } from "@colspec/core";

const registry = composeRegistries([inventoryRegistry, billingRegistry]);

A name registered twice throws unless you pass { onCollision: "override" }.

Send table state to your API

import { toServerQuery } from "@colspec/core";

toServerQuery(contract, { sorting, columnFilters, pagination });
// { sort: [{ key: "product.created_at", desc: true }], page: { index: 0, size: 25 } }

Only the operations the contract runs on the server are included.

JSON Schema

import schema from "@colspec/core/contract.schema.json" with { type: "json" };

Related packages

Documentation · MIT