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

@apso/schema-tools

v0.2.0

Published

Lint, autofix and edit Apso .apsorc schemas: one rule set plus targeted schema operations for the CLI, the platform, the AI schema builder and MCP agents.

Readme

@apso/schema-tools

Lint, autofix and edit .apsorc v2 schemas. One package shared by the Apso CLI (apso schema lint, the check before apso generate, and the MCP server), the platform, and the AI schema builder.

Lint

Errors mean the CLI would scaffold code that does not compile or a database you cannot insert into (for example a field notes on Contact next to Note ManyToOne Contact, which generates a second notes property). Warnings are quality issues.

import { lintSchema, fixSchema, formatLintReport } from "@apso/schema-tools";

const { schema, applied } = fixSchema(apsorc); // deterministic fixes only; never drops entities, and drops a relationship only when it is a ManyToMany a join entity already models
const result = lintSchema(schema);              // { issues, errorCount, warningCount }
console.log(formatLintReport(result));          // plain text for a terminal or an LLM prompt

Each issue is { rule, severity, entity?, field?, relationship?, message, fixable }. The rules live in src/rules.ts as a flat array; the relationship property names mirror @apso/cli src/lib/utils/relationships/parse.ts and must change with it.

Edit operations (agent tools)

Pure functions that take a schema and an input and return { schema, issues, ok, message, data? }. The input schema is never mutated. A write that would add a lint error is rejected: ok is false, the schema comes back unchanged, and message holds the lint report, so an agent can correct itself.

| Tool | Does | |---|---| | get_schema | Outline (default) or full JSON | | describe_entity | One entity plus the relationships that touch it | | add_entity, rename_entity, remove_entity | Entities; renames and removals update relationships and foreign key indexes | | add_field, update_field, rename_field, remove_field | Fields; renames and removals keep indexes and uniques in sync | | add_relationship, remove_relationship | Relationships | | add_index | Index or unique index, foreign key columns allowed | | lint_schema | The lint report |

import { addField, runSchemaTool, schemaTools } from "@apso/schema-tools";

const r = addField(apsorc, { entity: "Contact", field: { name: "phone", type: "text", nullable: true } });
if (!r.ok) console.log(r.message);

// The same definitions back AI SDK tools and MCP tools:
for (const t of schemaTools) {
  // t.name, t.description, t.inputSchema (JSON Schema), t.readOnly
}
runSchemaTool(apsorc, "rename_field", { entity: "Contact", field: "notes", newName: "notes_text" }); // validates input first