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

@alpaca-software/40kdc-data

v1.0.4

Published

The 40kdc Warhammer 40K dataset behind a linked, typed API — find units, follow them to their weapons, abilities, phases, and factions. Also validates data against the canonical JSON Schemas.

Readme

@alpaca-software/40kdc-data

Published by Alpaca Software.

The 40kdc Warhammer 40,000 dataset behind a linked, typed API. Find a unit, then walk straight to its weapons, abilities, the game phases those abilities act in, and its faction — all strongly typed, all resolved for you.

The full dataset is embedded in the package, so there is no network call, no database, and no filesystem access at runtime. It works the same in Node, bundlers, and the browser.

import { units } from "@alpaca-software/40kdc-data";

units.find("Kharn")!.abilities
  .filter(a => a.phases.includes("fight"))
  .map(a => a.id); // ["legendary-killer", "berzerker-frenzy"]

Install

npm install @alpaca-software/40kdc-data

The shape

Top-level collections (units, weapons, factions, abilities, detachments, stratagems, …) are accessors over a single embedded Dataset. Each collection is iterable and offers:

| Method | Returns | | --- | --- | | .all | every record (deduplicated) | | .get(id) | one record by exact id | | .find(nameOrId) | first match by id or name | | .findAll(nameOrId) | every match (surfaces names shared across factions) | | .byFaction(id) | records belonging to a faction |

Records resolve their links lazily:

  • unit.faction, unit.weapons, unit.abilities
  • ability.phases (joined from phase-mappings), ability.units
  • weapon.units
  • faction.units, faction.abilities, faction.weapons

The full underlying record is always available via .raw.

Name matching is built for a global player base

Warhammer 40,000 is played worldwide, and many names carry diacritics or punctuation — "Khârn the Betrayer", "T'au", "Be'lakor". find/findAll are diacritic- and punctuation-insensitive, so find("Kharn") resolves "Khârn the Betrayer" and find("Belakor") resolves "Be'lakor". The exact rule is exported as normalizeName so you can reproduce it in your own search UI.

API reference

Auto-generated from the source: docs/api/.

See it in action

Open-source example apps built on this package:

  • List Builder — build an army list and export to ListForge / NewRecruit.
  • Salvo — damage calculator over the cruncher and abilities-resolver.
  • Mission Matrix — the 11th-edition Force Disposition matchup grid.
  • Layout Editor — author terrain layouts on a board; exports terrain-layout JSON.
  • Hull Tracer — trace a model's collision hull from a top-down photo; exports geometry-only hull-shape JSON.

Also: schema validation

This package also ships the canonical JSON Schemas and an AJV-based validator (createValidator, listSchemaIds, and the 40kdc-validate CLI) for checking data against them. See the repository root for schema details.

Licensing & attribution

Public deployment requirement: Any publicly accessible application or service that ships this package as part of its end-user product must display a visible credit containing the text "Powered by 40kdc-data" and a link to https://40kdc.alpacasoft.dev in a user-accessible location (footer, about page, or credits section). Private use and library redistribution are exempt.

Stat lines and points are numerical facts. Ability and rules text are never stored — abilities are community-authored structured mechanics (the Ability DSL), not reproductions of copyrighted text.