
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
dmn-moddle
Advanced tools
Read and write DMN 1.3 files in NodeJS and the browser.
dmn-moddle uses the DMN specification to validate the input and produce correct DMN XML. The library is built on top of moddle and moddle-xml.
Get the library via npm package. Consume it in NodeJS or bundle it using your favorite build tool.
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);
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
Use under the terms of the MIT license.
FAQs
A moddle wrapper for DMN 1.3
The npm package dmn-moddle receives a total of 38,287 weekly downloads. As such, dmn-moddle popularity was classified as popular.
We found that dmn-moddle demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 11 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.