{"id":13640210,"url":"https://github.com/bpmn-io/bpmn-moddle","last_synced_at":"2025-06-30T05:33:19.363Z","repository":{"id":15673147,"uuid":"18410587","full_name":"bpmn-io/bpmn-moddle","owner":"bpmn-io","description":"Read and write BPMN 2.0 XML from JavaScript.","archived":false,"fork":false,"pushed_at":"2024-10-22T01:12:54.000Z","size":1058,"stargazers_count":446,"open_issues_count":3,"forks_count":162,"subscribers_count":28,"default_branch":"main","last_synced_at":"2024-10-29T20:25:25.072Z","etag":null,"topics":["bpmn","javascript","moddle","xml"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bpmn-io.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-04-03T16:46:38.000Z","updated_at":"2024-10-28T09:56:06.000Z","dependencies_parsed_at":"2024-01-14T11:10:38.625Z","dependency_job_id":"2d18458d-3eb6-4cdd-8dfb-db9a7eb45907","html_url":"https://github.com/bpmn-io/bpmn-moddle","commit_stats":{"total_commits":363,"total_committers":17,"mean_commits":"21.352941176470587","dds":0.303030303030303,"last_synced_commit":"ea7fa6a94c55f49fe1da1f019dc9a40d62967252"},"previous_names":[],"tags_count":82,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bpmn-io%2Fbpmn-moddle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bpmn-io%2Fbpmn-moddle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bpmn-io%2Fbpmn-moddle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bpmn-io%2Fbpmn-moddle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bpmn-io","download_url":"https://codeload.github.com/bpmn-io/bpmn-moddle/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223816483,"owners_count":17207868,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bpmn","javascript","moddle","xml"],"created_at":"2024-08-02T01:01:08.889Z","updated_at":"2024-11-09T10:31:00.402Z","avatar_url":"https://github.com/bpmn-io.png","language":"JavaScript","funding_links":[],"categories":["Libraries"],"sub_categories":[],"readme":"# bpmn-moddle\n\n[![CI](https://github.com/bpmn-io/bpmn-moddle/workflows/CI/badge.svg)](https://github.com/bpmn-io/bpmn-moddle/actions?query=workflow%3ACI)\n\nRead and write BPMN 2.0 diagram files in NodeJS and the browser.\n\n__bpmn-moddle__ uses the [BPMN 2.0 meta-model](http://www.omg.org/spec/BPMN/2.0/) to validate the input and produce correct BPMN 2.0 XML.\n\n\n## Usage\n\nGet the library via [npm package](https://www.npmjs.org/package/bpmn-moddle). Consume it in NodeJS, via UMD or bundle it using your favorite build tool.\n\n```javascript\nimport BpmnModdle from 'bpmn-moddle';\n\nconst moddle = new BpmnModdle();\n\nconst xmlStr =\n  '\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e' +\n  '\u003cbpmn2:definitions xmlns:bpmn2=\"http://www.omg.org/spec/BPMN/20100524/MODEL\" ' +\n                     'id=\"empty-definitions\" ' +\n                     'targetNamespace=\"http://bpmn.io/schema/bpmn\"\u003e' +\n  '\u003c/bpmn2:definitions\u003e';\n\n\nconst {\n  rootElement: definitions\n} = await moddle.fromXML(xmlStr);\n\n// update id attribute\ndefinitions.set('id', 'NEW ID');\n\n// add a root element\nconst bpmnProcess = moddle.create('bpmn:Process', { id: 'MyProcess_1' });\ndefinitions.get('rootElements').push(bpmnProcess);\n\n// xmlStrUpdated contains new id and the added process\nconst {\n  xml: xmlStrUpdated\n} = await moddle.toXML(definitions);\n```\n\n\n## Resources\n\n* [Issues](https://github.com/bpmn-io/bpmn-moddle/issues)\n* [Examples](https://github.com/bpmn-io/bpmn-moddle/tree/master/test/spec/xml)\n* [Changelog](./CHANGELOG.md)\n\n\n## Building the Project\n\nThe tests include XSD schema validation. They required you to have a Java SDK installed and exposed through the `JAVA_HOME` variable.\n\n```bash\n# execute the test\nnpm test\n\n# perform a full build\nnpm run all\n```\n\n\n## Related\n\nThe library is built on top of [moddle](https://github.com/bpmn-io/moddle) and [moddle-xml](https://github.com/bpmn-io/moddle-xml).\n\n\n## License\n\nUse under the terms of the [MIT license](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbpmn-io%2Fbpmn-moddle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbpmn-io%2Fbpmn-moddle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbpmn-io%2Fbpmn-moddle/lists"}