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

bpmn-elk-layout

v1.3.0

Published

Convert ELK-BPMN JSON to BPMN 2.0 XML with automatic layout calculation. Supports all BPMN 2.0 elements including events, tasks, gateways, subprocesses, and swimlanes.

Readme

bpmn-elk-layout

npm version License: MIT

Convert ELK-BPMN JSON to standard BPMN 2.0 XML with automatic layout calculation.

ELK-BPMN JSON (AI-generated) → elkjs layout → BPMN 2.0 XML (with DI) → bpmn.io/Camunda

Features

  • 🎯 Automatic Layout - No manual coordinate calculation needed
  • 🔄 Full BPMN 2.0 Support - Events, tasks, gateways, subprocesses, swimlanes
  • 📐 Smart Edge Routing - Clean perpendicular connections with no overlaps
  • 🏊 Swimlane Support - Pools, lanes, and collaborations
  • 🛠️ CLI & Library - Use programmatically or from command line
  • 📦 Dual Format - Works in both Node.js and browser environments

Installation

npm install bpmn-elk-layout
# or
yarn add bpmn-elk-layout
# or
pnpm add bpmn-elk-layout

Quick Start

As a Library

import { BpmnElkLayout } from 'bpmn-elk-layout';

const converter = new BpmnElkLayout();

// Convert to BPMN XML
const xml = await converter.to_bpmn(elkBpmnJson);

// Or get layouted JSON with coordinates
const layouted = await converter.to_json(elkBpmnJson);

CLI

# Convert to BPMN XML
npx bpmn-elk-layout convert input.json -f bpmn -o output.bpmn

# Convert to layouted JSON
npx bpmn-elk-layout convert input.json -f json -o output.json

Input Format (ELK-BPMN JSON)

The input is standard ELK JSON extended with a bpmn field for BPMN semantics:

{
  "id": "definitions",
  "children": [{
    "id": "process_1",
    "bpmn": { "type": "process", "name": "My Process" },
    "children": [
      {
        "id": "start",
        "bpmn": { "type": "startEvent", "name": "Start" }
      },
      {
        "id": "task_1",
        "bpmn": { "type": "userTask", "name": "Review Request" }
      },
      {
        "id": "end",
        "bpmn": { "type": "endEvent", "name": "End" }
      }
    ],
    "edges": [
      { "id": "flow_1", "sources": ["start"], "targets": ["task_1"] },
      { "id": "flow_2", "sources": ["task_1"], "targets": ["end"] }
    ]
  }]
}

BPMN 2.0 Coverage

Events

  • Start/End/Intermediate events (catch & throw)
  • Boundary events (interrupting & non-interrupting)
  • Event definitions: None, Message, Timer, Error, Escalation, Cancel, Compensation, Conditional, Link, Signal, Terminate, Multiple, ParallelMultiple

Activities

  • Tasks: User, Service, Script, Business Rule, Send, Receive, Manual
  • SubProcesses: Embedded, Event, Transaction, Ad-hoc
  • Call Activity with parameter mapping
  • Loop & Multi-instance (parallel/sequential)

Gateways

  • Exclusive, Parallel, Inclusive, Event-based, Complex
  • Default flow support

Data & Artifacts

  • Data Object, Data Store, Data Input/Output
  • Text Annotation, Group
  • Data Association

Swimlanes

  • Participant/Pool (including black-box)
  • Lane (with nesting support)
  • Collaboration with Message Flows

Node.js Usage

For Node.js environments with better performance using native ELK:

import { BpmnElkLayout } from 'bpmn-elk-layout/node';

const converter = new BpmnElkLayout();
const xml = await converter.to_bpmn(elkBpmnJson);

API Reference

BpmnElkLayout

to_bpmn(json: ElkBpmnGraph): Promise<string>

Converts ELK-BPMN JSON to BPMN 2.0 XML string with diagram interchange (DI) information.

to_json(json: ElkBpmnGraph): Promise<LayoutedGraph>

Converts ELK-BPMN JSON to layouted JSON with calculated x, y coordinates.

How It Works

  1. Parse - Read ELK-BPMN JSON input
  2. Prepare - Convert to ELK graph format with BPMN constraints
  3. Layout - Run elkjs layout engine for automatic positioning
  4. Post-process - Apply BPMN-specific adjustments (boundary events, lanes, etc.)
  5. Generate - Output BPMN 2.0 XML with diagram information

Dependencies

Requirements

  • Node.js >= 18.0.0

License

MIT

Links