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

@brass-lantern/engine

v2.1.1

Published

The Brass Lantern text-adventure engine: worlds as data, a regex parser, a headless turn loop, and a Z-machine runtime for story files.

Readme

Brass Lantern engine

@brass-lantern/engine: worlds as data, a forgiving regex parser, a deterministic turn loop that runs in Node or the browser, and a Z-machine runtime for story files like Zork. No Vue, no DOM.

Install

npm i @brass-lantern/engine

Node 24 or later. TypeScript 5 or later works with bundler, node16 and nodenext resolution; the public types mention fetch and Storage, so include the DOM lib or @types/node.

Use

import { auditWorld, createGame } from '@brass-lantern/engine';
import { tutorial } from '@brass-lantern/engine/worlds';

console.log(auditWorld(tutorial));            // [] when the world has no broken references

const game = createGame(tutorial, { seed: 1 });
console.log(game.opening.join('\n'));
const reply = game.send('open drawer then take stapler');
console.log(reply.lines.join('\n'));          // reply: { lines, gameOver, awaiting }

RESTART and UNDO work headless; SAVE, RESTORE, LOAD and SCRIPT say they aren’t available here and change nothing.

Entry points

| Import | What | |---|---| | @brass-lantern/engine | createGame, auditWorld, the parser, execute and the types (World, Cartridge, GameState) | | @brass-lantern/engine/worlds | The bundled worlds: Snack Attack (tutorial), Zork I (zork1) and the docs examples | | @brass-lantern/engine/zmachine | Story files without the interpreter: readStoryFile, IndexedDbShelf, SaveStore, localStorageSaveStore, SaveStoreDialog and the types | | @brass-lantern/engine/zmachine/session | ZMachineSession, which loads the interpreter (ifvms): import it dynamically to keep it in a chunk of its own |

The core, ./worlds and ./zmachine also load with require() on Node 24 and later; ./zmachine/session is ESM only (it uses top-level await, so require() throws ERR_REQUIRE_ASYNC_MODULE).

Story files

The Z-machine session uses ifvms, an optional peer dependency: install it (npm i ifvms) to use ./zmachine/session in Node. Without it the import fails with an error that names the package. ./zmachine never needs it.

Credits

Zork I (zork1), text adapted from Infocom’s source, © 2025 Microsoft, MIT; the Glk library (glkapi.js) © Andrew Plotkin, MIT. See THIRD_PARTY_NOTICES.md, in this package and in the repo.

Docs

Using the library is the guide for all three packages; the docs cover worlds, story files and the intent server. Source and issues: github.com/mrballistic/brass-lantern. MIT licensed.