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

@osdk/seed-compiler

v0.18.0

Published

Merges seed data files (`.mts`) into a single JSON output for the local ontology server to load into SQLite on startup.

Readme

@osdk/seed-compiler

Merges seed data files (.mts) into a single JSON output for the local ontology server to load into SQLite on startup.

Usage

CLI

seed-compiler \
  --metadata path/to/ontology-metadata.json \
  --seed-dir path/to/seed/ \
  --output path/to/seed-data.json

| Flag | Description | | ------------ | --------------------------------------------------------------------------------------------------------------------------------------- | | --metadata | Path to the ontology-metadata.json file written by the SDK generator. Backs the OntologySeedBuilder the files are merged through. | | --seed-dir | Directory containing seed .mts files. All top-level .mts files are loaded, sorted by filename for deterministic output, and merged. | | --output | Path where the merged seed JSON is written. |

Authoring seed files

Seed files use a metadata-bound createSeed — createOntologySeedWithMetadata() from @osdk/seed-helpers partially applied to your ontology's metadata — together with the user's generated @ontology/sdk. Each file must default-export either the createSeed(...) result (the { output, context } object) or its .output (a bare OntologySeedOutput); the compiler tells the two apart structurally and treats them identically. Exporting the result itself is the recommended form, since context stays available to anything else importing the file:

import { Product, Seller } from "@ontology/sdk";

import { createSeed } from "./createSeed.js";

export default createSeed((seed) => {
  const widget = seed.create(Product, {
    productId: "prod-001",
    title: "Widget",
    price: 100,
  });
  const alice = seed.create(Seller, {
    sellerId: "seller-001",
    name: "Alice",
  });

  // Link by reference — full compile-time validation on link names and target types.
  seed.link(widget, "sellers", alice);
});

seed.link() also accepts an array of targets:

seed.link(widget, "sellers", [alice, bob]);

where createSeed is defined once per project as:

import metadata from "@ontology/sdk/experimental/ontology-metadata";
import {
  createOntologySeedWithMetadata,
  type OntologySeedFunction,
  type OntologySeedOutput,
} from "@osdk/seed-helpers";

export const createSeed = <T>(
  fn: OntologySeedFunction<T>,
): { output: OntologySeedOutput; context: T } =>
  createOntologySeedWithMetadata(metadata, fn);

Validation

Validation is not this package's job. @osdk/seed-helpers validates every object as seed.create() / seed.update() inserts it, and again when the compiler feeds each file's output into its shared OntologySeedBuilder:

  • Object types must be defined in the ontology (via the metadata file).
  • Property names must exist on the object type, and values must be non-null and match the wire type's expected JS type.
  • String-encoded property values must match the regex format for their wire type (timestamp, date, datetime, long, decimal).
  • Primary keys must be unique within an object type.

Because all files are merged through one OntologySeedBuilder, primary-key uniqueness holds across the whole directory, not just within a file. The compiler's only addition is the seed file's name in the error message, so a conflict points at the file that introduced it.

Links are deduplicated by their identity (source, link type, target). Link entries may reference objects created in any seed file in the directory, and a link's name is derived from that identity rather than taken from the input.