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/server

v0.1.1

Published

Store, version, publish and serve colspec table definitions from any database or Node.js framework.

Readme

@colspec/server

Store, version and serve colspec table definitions from your own backend. It works with any database and any Node.js framework, and needs no ORM or separate service.

npm install @colspec/server @colspec/core

1. Implement storage

One row or document per revision, unique by (tableId, revision).

import type { TableDefinitionRepository } from "@colspec/server";

const repository: TableDefinitionRepository = {
  find: (tableId, revision) => /* one record or undefined */,
  findLatest: (tableId, status) => /* highest revision with that status */,
  list: (tableId) => /* all revisions, oldest first */,
  save: (record) => /* insert or replace */,
};

createMemoryRepository() is included for tests and prototypes.

2. Manage definitions

import { createTableDefinitionService } from "@colspec/server";

const definitions = createTableDefinitionService(repository);

await definitions.saveDraft(json); // validates; throws ContractError if invalid
await definitions.publish("inventory.products", 4);
await definitions.getPublished("inventory.products"); // latest published revision
await definitions.listRevisions("inventory.products");

Drafts can be saved repeatedly. A published revision is immutable; change a table by saving a new revision number.

3. Serve them

getDefinitionResponse returns { status, headers, body } with an ETag and 304 Not Modified handling.

app.get("/api/table-definitions/:tableId", async (req, res) => {
  const { status, headers, body } = await getDefinitionResponse(definitions, {
    tableId: req.params.tableId,
    ifNoneMatch: req.get("if-none-match"),
  });
  res.status(status).set(headers).json(body);
});

4. Accept sort and filter requests safely

Clients send operation keys, not field names. Map every key through a list you control.

import { resolveServerQuery } from "@colspec/server";

const result = resolveServerQuery(untrustedJson, {
  "product.created_at": "products.created_at",
  status: "products.status",
});

if (!result.ok) return badRequest(result.diagnostics);
const { sort, filters, page } = result.value; // only fields from your list

Malformed input and unlisted keys are rejected. Filter values are still untrusted: validate or coerce them before they reach a query.

Not included

Authentication and authorization. Decide in your application who may save, publish and read definitions.

Documentation · NestJS + MongoDB example · MIT