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

mons-web

v0.2.0

Published

super metal mons

Readme

Mons TypeScript engine

The Mons rules engine is implemented in strict TypeScript and distributed as two dependency-free npm packages:

  • mons-web is an ES module for browsers and bundlers.
  • mons-rust is the existing CommonJS package for Node.js. Its historical package name is unchanged for compatibility.

Both packages expose the same 23 named game APIs and the same TypeScript declarations.

import { GameVariant, MonsGameModel } from "mons-web";

const game = MonsGameModel.new(GameVariant.Classic);
const output = game.process_input_fen("l10,5;l9,4");
const { GameVariant, MonsGameModel } = require("mons-rust");

const game = MonsGameModel.new(GameVariant.Classic);

Migrating mons-web initialization

mons-web no longer has a default initializer or an initSync export. Remove the default import and initialization call; named imports are ready to use immediately. The generated InitInput, SyncInitInput, and InitOutput TypeScript types are removed with those loaders.

-import initMonsWeb, { MonsGameModel } from "mons-web";
-await initMonsWeb();
+import { MonsGameModel } from "mons-web";

The named API is otherwise preserved, including enum values, FEN formats, model classes, event ordering, random automoves, and smart-automove preferences.

Incoming strings retain the previous runtime normalization: unpaired UTF-16 surrogates become U+FFFD before parsing or echoing. One intentional error-policy change applies to malformed data: native RuntimeError("unreachable") traps from invalid UTF-8 slice boundaries or genuine board/location bounds failures are deterministic TypeScript RangeErrors. Wrapped location indices that resolve inside the board remain compatible aliases.

Published JavaScript targets ES2020. The Node package uses Node's built-in performance and cryptographic-random services directly; the browser package uses the corresponding globalThis APIs. Node.js 22.13 through 22.x, or Node.js 24 or newer, is required only for repository development and release tooling.

Validation

Install the workspace with Node.js 22.13 through 22.x, or Node.js 24 or newer, and run the standard checks:

npm ci --engine-strict
npm run format:check
npm run lint
npm run typecheck
npm run build
npm test
npm run test:automove-parity

Run ./scripts/run-rules-tests.sh with no options to replay the deterministic compressed stream of 699,994 canonical unique rules transitions recovered from 699,999 historical raw fixtures. The command validates and streams the corpus without unpacking or rewriting it.

Run node ./scripts/check-complete-games.cjs to validate the immutable public corpus of 1,527 complete real-player games. Run npm run test:complete-games to replay all 25,185 turns and 169,480 inputs through the TypeScript engine across all 12 variants.

Release

Run ./publish.sh --check-only to execute the complete Node-only validation, build both package tarballs, and perform npm dry runs without publishing. Publishing is an explicit release operation: run ./publish.sh from a clean worktree only when both packages should be released to the latest tag.

A real publish acquires the transient mons-npm-publish-lock tag on origin, or on the shared remote named by MONS_PUBLISH_LOCK_REMOTE. All publishers must use this script and the same remote for the lock to serialize releases across hosts. If a process terminates without releasing the tag, the script prints inspection and lease-protected stale-lock recovery commands.