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

landlord-ts

v1.0.3

Published

Monte Carlo MTG on-curve simulator (TypeScript port of landlord)

Readme

landlord-ts

Pure TypeScript Monte Carlo simulator for Magic: The Gathering on-curve probabilities. Port of the Rust landlord engine used by mtgoncurve.com.

Requirements

  • Node.js 24 recommended (see .nvmrc); engines.node is >=22

Install

npm install landlord-ts

Usage

import { run } from 'landlord-ts';

const runs = 10_000;

const input = {
  code: `
1 Llanowar Elves
1 Forest
  `,
  runs,
  onThePlay: true,
  mulliganDownTo: 5,
  mulliganOnLands: [0, 1, 6, 7],
  acceptableHandList: [],
};

const output = run(input);

console.log({
  deckSize: output.deckSize,
  deckAverageCmc: output.deckAverageCmc,
  totalSimulations: output.totalSimulations,
  // Often < 7: London mulligans put cards on the bottom
  avgOpeningHandSize: output.avgOpeningHandSize,
  avgOpeningLandCount: output.avgOpeningLandCount,
});

for (const row of output.cards) {
  console.log({
    name: row.name,
    manaCost: row.manaCost,
    copies: row.copies,
    playedOnCurve: row.playedOnCurve,
    notPlayedOnCurve: row.notPlayedOnCurve,
    totalSimulations: row.totalSimulations,
    pCastOnCurve: row.pCastOnCurve,
    pManaGivenCmc: row.pManaGivenCmc,
    notEnoughLands: row.notEnoughLands,
    colorOrTimingFail: row.colorOrTimingFail,
    manaOkUndrawn: row.manaOkUndrawn,
  });
}

for (const land of output.landCounts) {
  console.log({
    name: land.name,
    kind: land.kind,
    copies: land.copies,
    producedMana: land.producedMana,
  });
}

RunInput / RunOutput use camelCase field names. RunOutput is a single flattened on-curve report (cards, ranked insights, land tallies).

Validate a textarea decklist before simulating with parseDecklist(code) (non-throwing Result; unknown cards set error.unknownCardNames).

For the full RunInput / RunOutput contract, runAsync (progress callbacks), and Next.js SSE streaming, see the wiki:

Development

npm install
npm run card-update   # fetch Scryfall bulk data → data/all_cards.json.gz
npm test
npm run build
npm run release:check

See CONTRIBUTING.md for the branch model, hooks, and PR checklist. Maintainers: RELEASING.md.

Branching

  • develop — integration branch; open feature PRs here
  • main — releases only (developmain)

Wiki

This repo uses llm-wiki-manager. See AGENTS.md and wiki/AGENTS.md.

npm run wiki:help
npm run wiki:lint

Card data

Shipped card data in data/all_cards.json.gz is derived from Scryfall bulk oracle data. This project is not affiliated with Scryfall. Regenerate with npm run card-update.

License

MIT — see also SECURITY.md and CODE_OF_CONDUCT.md.