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

@omphalos-sorcery-tcg/cards

v0.1.0

Published

Canonical card data, domain types, deck validation, and a data-loading client for Sorcery: Contested Realm (Omphalos).

Downloads

167

Readme

@omphalos-sorcery-tcg/cards

Canonical card data for Sorcery: Contested Realm, shared across the Omphalos projects (the web app today; a game server / rules engine later).

This package owns three things:

  1. Domain types (src/index.ts) — Card, CardSummary, StatBlock, etc., modeled on the official API, plus small pure helpers (imageUrl, printings).
  2. Deck domain + construction validation (src/deck.ts) — Deck, DeckCard, and validateDeck() (rulebook p.26: one Avatar, Atlas ≥ 30, Spellbook ≥ 60, per-rarity copy limits).
  3. A data-loading client (src/client.ts) — createCardClient({ baseUrl }) returning loadIndex() / loadCardDetail(), so any consumer reads the same data from any origin.

Scope note. This is display + deck-construction data. The structured, machine-executable card abilities a legal-move game engine needs do not live here yet — that's a future layer built on top of these types.

Layout

src/
  index.ts          types + helpers (entry point)
  deck.ts           deck model + validateDeck()
  client.ts         createCardClient() data loader
scripts/
  download_cards.py pulls the API snapshot + ~3 GB of card images
  split-cards.mjs   derives index.json + chunks/ from the snapshot

The data artifact (not in git)

Card data is large and regenerable, so it's gitignored, not committed:

  • download_cards.pycards.json (raw API snapshot) + cards/<slug>.png images.
  • split-cards.mjsindex.json (one summary per card) + chunks/cards-N.json (full records, fetched on demand).
python scripts/download_cards.py     # writes ./public/cards.json + ./public/cards/
node scripts/split-cards.mjs         # writes ./public/index.json + ./public/chunks/

Both scripts accept a target dataDir as their first argument (resolved against the current working directory), so a consumer can generate the artifact straight into its own served directory:

node node_modules/@omphalos-sorcery-tcg/cards/scripts/split-cards.mjs public
python node_modules/@omphalos-sorcery-tcg/cards/scripts/download_cards.py public

Consuming it

import { createCardClient, validateDeck, type CardSummary } from "@omphalos-sorcery-tcg/cards";

const cards = createCardClient({ baseUrl: "" }); // "" = same origin
const index = await cards.loadIndex();
const detail = await cards.loadCardDetail(index[0]);

During local development apps/web consumes this package from source via a path alias (Vite + tsconfig paths), so no build step is required while iterating — matching how the monorepo previously consumed its local types.

Publishing (later)

package.json currently points main/types/exports at the TypeScript source. Before publishing to a registry for JS consumers:

  1. npm run build (emits dist/ + .d.ts via tsc).
  2. Repoint exports at dist/ (e.g. ".": ./dist/index.js + ./dist/index.d.ts).
  3. Consider moduleResolution: NodeNext with explicit file extensions for broad compatibility.

Then consumers can depend on a versioned @omphalos-sorcery-tcg/cards instead of a local source alias, and the data artifact can ship as a CDN-hosted release asset.