Launch Week Day 1: Socket for Jira Is Now Available.Learn More
Socket
Book a DemoSign in
Socket

dmn-moddle

Package Overview
Dependencies
Maintainers
11
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dmn-moddle

A moddle wrapper for DMN 1.3

latest
Source
npmnpm
Version
12.0.1
Version published
Weekly downloads
47K
-20.99%
Maintainers
11
Weekly downloads
 
Created
Source

dmn-moddle

CI

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.

Usage

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);

Resources

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.

Keywords

dmn

FAQs

Package last updated on 20 Jan 2026

Did you know?

Socket

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.

Install

Related posts