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

@emaarco/dmn-js-simulation

v0.2.0

Published

Simulate DMN decision tables directly in a dmn-js modeler — see which rules match and what the decision returns.

Readme

@emaarco/dmn-js-simulation

npm version license live demo

Simulate DMN decision tables directly in a dmn-js modeler — feed in concrete inputs and instantly see which rules match, which don't, and what the decision returns.

Simulating a DMN decision table — the input form runs the decision and highlights the matched rule

The idea behind this project

@emaarco/dmn-js-simulation is to DMN what bpmn-js-token-simulation is to BPMN: it lets you validate decision logic while you model it, instead of discovering mistakes later in process code, tests, or production. It supports all DMN hit policies (UNIQUE, FIRST, ANY, PRIORITY, COLLECT with SUM/MIN/MAX/COUNT, RULE ORDER, OUTPUT ORDER) and multi-decision DRD chaining.

Features

  • Decision-table simulation — an input form appears above the table; run it to highlight the matched rule(s) and read off the result. Rules dropped by the hit policy (e.g. under FIRST/PRIORITY) are shown as dimmed candidates, so the policy's effect is visible.
  • All hit policies, including COLLECT aggregations and policy-violation warnings (e.g. UNIQUE matched twice).
  • DRD chaining — simulate a whole decision requirement graph: set the input-data leaves once, and every decision is evaluated in dependency order. Fired decisions are highlighted and annotated with their result; drilling into a decision reflects that run's row highlights.
  • Drop-in — installs like any dmn-js module via additionalModules; dmn-js is a peer dependency, so it drives the modeler you already use.
  • Themeable — all UI is class-namespaced and driven by CSS variables you can override.

Installation

npm install @emaarco/dmn-js-simulation

dmn-js (>= 17) is a peer dependency — install it if you haven't already.

Usage

import DmnModeler from 'dmn-js/lib/Modeler'
import DmnSimulationModule from '@emaarco/dmn-js-simulation'
import '@emaarco/dmn-js-simulation/assets/dmn-js-simulation.css'

const modeler = new DmnModeler({
  container: '#canvas',
  decisionTable: { additionalModules: [DmnSimulationModule.decisionTable] },
  drd: { additionalModules: [DmnSimulationModule.decisionRequirementsDiagram] },
})

await modeler.importXML(dmnXml)

Register only the view(s) you need. The modules are also exported individually:

import { DmnSimulationTableModule, DmnSimulationDecisionRequirementsDiagramModule } from '@emaarco/dmn-js-simulation'

DRD view: make sure your app imports dmn-js's icon font (dmn-js/dist/assets/dmn-font/css/dmn-embedded.css) alongside its other stylesheets — otherwise the DRD editor palette icons render blank.

Evaluate without a modeler

The framework-free evaluation core is exported too, for tests or headless use:

import { parseDecisionModelFromXml, evaluateDecision } from '@emaarco/dmn-js-simulation'

const model = parseDecisionModelFromXml(dmnXml)
const result = evaluateDecision(model, ['Fall', 8])
// → { matchedRuleIndices, reportedRuleIndices, outputs, aggregation?, violation? }

evaluateDecisionRequirementsDiagram + definitionsToDecisionRequirementsDiagramModel do the same for a whole DRD graph.

Contributing

Contributions are welcome — see CONTRIBUTING.md for the monorepo layout, scripts, and how to build, test and run the example locally.

Credits

License

MIT © Marco Schäck