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

@milehimikey/em

v1.13.0

Published

AI-friendly Event Modeling — a slice-first text DSL rendered to a strict, self-contained Graphviz grid (SVG/PNG)

Downloads

2,663

Readme

em — event modeling in plain text

em is a command-line tool for Event Modeling. You write a model in a small, slice-first DSL and em renders it as a clean, deterministic diagram. Because the source is plain text — diff-able, reviewable, unambiguous — it's as easy for an AI to write and edit as it is for a person, and em validate keeps either one honest.

An order-fulfillment event model rendered by em

The source for that diagram is about 70 lines of text — or see it as a full project, slice docs and all, for a guided tour of the rest of the toolchain.

Install

npm install -g @milehimikey/em

Requires Node ≥ 18. SVG, PNG, and PDF rendering are all fully self-contained (Graphviz runs as bundled WebAssembly); nothing else to install. Only rarer formats (ps, eps, ...) need an optional system dependency — see docs/dependencies.md.

Quickstart

em init model.em          # scaffold a starter model
em render model.em        # -> model.svg  (open it in a browser)
em watch model.em --serve # live browser view, re-renders on every save
em validate model.em      # check event-modeling rules

Once a model is real and committed, em keeps working on it over time:

em export model.em        # versioned JSON, for agents and tooling
em diff model.em --from HEAD~1   # what this change did to the model
em changelog model.em     # the model's git history as a business ledger

A system of several models — one per team or sub-department, each in its own directory — gets the same treatment across model boundaries: a seam manifest (system.yaml) declares which model's public event feeds which other model's Translation slice, and em system system.yaml verifies every binding against the models' exports and emits the org-level context map (docs/cli.md; worked example in examples/multi-model/).

A model is a list of slices — vertical time steps, read left to right — whose elements land in swimlane rows:

model "Order Fulfillment"

persona Customer
context Order

slice "Browse Catalog" {
  ui Product Catalog @Customer
  command Place Order
  event Order Placed @Order
}

slice "View Open Orders" {
  view Open Orders from "Order Placed"
  ui Order List @Customer
}

The tutorial builds a complete model from an empty file in about twenty minutes, and docs/workflow.md picks up where it leaves off: how a model gets specified, gated in CI, handed to implementation, and checked against the code that implements it.

How it works

Model, gate, ratify, implement, check — repeat as the system evolves. Humans make the calls that matter (build the model, ratify a slice, rule on drift); em and its agents handle the mechanical parts in between. This is the loop in miniature — see docs/workflow.md for the full seven-stage lifecycle and docs/process.md for exactly who (or what) does each part.

flowchart LR
    Model["Model<br/>.em file"] --> Gate["Gate<br/>em validate in CI"]
    Gate --> Ratify["Ratify a slice<br/>a human signs off"]
    Ratify --> Implement["Implement<br/>agent or engineer builds it"]
    Implement --> Conform["Conform<br/>em conform checks the code"]
    Conform -->|drift found, ratified| Model

Model with AI

em ships a Claude Code skill bundle — one router skill plus five focused, SDLC-stage skills (discover/extract, model/slice, implement, conform/validate, watch/review) — that runs a facilitated Event Modeling session: the AI asks the questions, you supply the domain, and the model renders live as it grows.

em skill install          # copy the skill bundle into .claude/skills/

Then run /event-modeling in Claude Code. The same bundle also runs the reverse direction: extract derives a model from a system that already exists, and conform checks a model against the code implementing it and reports where they've drifted. See docs/ai-workflow.md for the phases and what a session produces, and the em-with-ai repository for a ~50-slice model built this way.

Documentation

| Doc | What it answers | |---|---| | docs/tutorial.md | Learn the tool by building a model from scratch | | docs/workflow.md | The model lifecycle: specify, gate, hand off, track change, detect drift | | docs/process.md | Who does what: where humans are required, where agents work with review | | docs/patterns.md | The four Event Modeling patterns and their DSL shapes | | docs/dsl.md | Full DSL reference: keywords, from, again, fields, notes | | docs/cli.md | Every command and flag | | docs/validation.md | Every rule em validate checks, and the fixes | | docs/ci.md | Copy-paste CI recipes: validate .em changes, run conformance on a schedule | | docs/upgrading.md | Bring a model repo forward across em releases: em upgrade, release by release | | docs/timeline.md | The Two Laws of the Timeline | | docs/ai-workflow.md | The Claude Code skill: install, phases, artifacts | | docs/dependencies.md | What's bundled vs. what needs a system install | | docs/usage-data.md | What usage data em captures, and how to roll it up for a retro | | docs/architecture.md | How rendering works; why Graphviz, not PlantUML | | docs/roadmap.md | What's planned | | docs/decisions/ | Write-ups for open design questions (MIL-162, the stakeholder-portal decision; MIL-194, the seam manifest) |

Development

npm install
npm run build          # produces dist/, exposes the `em` bin
npm test               # vitest
npx tsx src/cli.ts <command> ...   # run straight from source

License

MIT © milehimikey