# dmn-moddle

> A moddle wrapper for DMN 1.3

Latest version **12.2.1** (published 2026-09-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install dmn-moddle
pnpm add dmn-moddle
yarn add dmn-moddle
bun add dmn-moddle
```

## Health

**Score 60/100 (C)** — status: active.

Positive: esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 12.2.1 |
| Published | 2026-09-21 |
| First published | 2015-08-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >= 20.12 |
| Dependencies | 3 |
| Unpacked size | 100.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 14 |
| Author | Sebastian Stamm |
| Maintainers | bpmn-io-admin, nikku, barmac, philippfromme, maxtru, skaiir-camunda, vsgoulart, barinali, ev-camunda, jarekdanielak, alekseymanetov, sebastian.stamm |
| Keywords | dmn, moddle, meta-model |

## Links

- npm: https://www.npmjs.com/package/dmn-moddle
- Repository: https://github.com/bpmn-io/dmn-moddle
- Homepage: https://github.com/bpmn-io/dmn-moddle#readme
- Issues: https://github.com/bpmn-io/dmn-moddle/issues
- npm.io page: https://npm.io/package/dmn-moddle

## Dependencies (3)

- [moddle](https://npm.io/package/moddle.md) ^8.2.1
- [min-dash](https://npm.io/package/min-dash.md) ^5.1.0
- [moddle-xml](https://npm.io/package/moddle-xml.md) ^12.3.1

## Recent versions

- 12.2.1 (latest) — 2026-09-21
- 12.2.0 — 2026-09-21
- 12.1.0 — 2026-08-25
- 12.0.1 — 2026-01-20
- 12.0.0 — 2026-01-20
- 11.0.0 — 2025-07-09
- 10.0.0 — 2021-05-10
- 9.1.0 — 2020-07-03
- 9.0.0 — 2020-02-25
- 8.0.4 — 2020-02-24
- 8.0.3 — 2020-02-20
- 8.0.2 — 2020-02-06
- 8.0.1 — 2020-01-31
- 8.0.0 — 2020-01-24
- 7.0.0 — 2019-12-12
- … 22 more at https://npm.io/package/dmn-moddle/versions

## README

# dmn-moddle

[![CI](https://github.com/bpmn-io/dmn-moddle/workflows/CI/badge.svg)](https://github.com/bpmn-io/dmn-moddle/actions?query=workflow%3ACI)

Read and write DMN 1.3 files in NodeJS and the browser.

__dmn-moddle__ uses the [DMN specification](http://www.omg.org/spec/DMN/1.3/) to validate the input and produce correct DMN XML. The library is built on top of [moddle](https://github.com/bpmn-io/moddle) and [moddle-xml](https://github.com/bpmn-io/moddle-xml).


## Usage

Get the library via [npm package](https://www.npmjs.org/package/dmn-moddle). Consume it in NodeJS or bundle it using your favorite build tool.

```javascript
import { DmnModdle } from 'dmn-moddle';

const moddle = new DmnModdle();

const xmlStr =
  '<?xml version="1.0" encoding="UTF-8"?>' +
    '<definitions xmlns="https://www.omg.org/spec/DMN/20191111/MODEL/" ' +
                 'id="Definitions_1" ' +
                 'namespace="http://camunda.org/schema/1.0/dmn">' +
      '<decision id="Decision_1" name="Decision" />' +
    '</definitions>;


const {
  rootElement: definitions
} = await moddle.fromXML(xmlStr);

// update id attribute
definitions.set('id', 'NEW ID');

// add a root element
const dmnDecision = moddle.create('dmn:Decision', { id: 'MyDecision' });
definitions.get('drgElement').push(dmnDecision);

// xmlStrUpdated contains new id and the added process
const {
  xml: xmlStrUpdated
} = await moddle.toXML(definitions);
```


## Resources

* [Issues](https://github.com/bpmn-io/bpmn-moddle/issues)
* [Examples](https://github.com/bpmn-io/bpmn-moddle/tree/master/test/spec/xml)
* [Changelog](./CHANGELOG.md)


## Building the Project

To run the test suite that includes XSD schema validation you must have a Java JDK installed and properly exposed through the `JAVA_HOME` variable.

Execute the test via

```
npm test
```

Perform a complete build of the library via

```
npm run all
```


## License

Use under the terms of the [MIT license](http://opensource.org/licenses/MIT).

---
_Source: https://npm.io/package/dmn-moddle · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
