@cleveloper/dex
v0.2.0
Published
Gliffy diagram conversion library and CLI
Readme
dex — Gliffy Diagram Exporter
Convert Gliffy .gliffy files to Draw.io XML, Mermaid, or PlantUML.
Available as a CLI tool and a TypeScript/Node.js library.
CLI
Install globally:
npm install -g @cleveloper/dexConvert a diagram:
dex diagram.gliffy -f mermaid
dex diagram.gliffy -f drawio -o diagram.drawio
dex diagram.gliffy -f plantumlFlags:
| Flag | Description |
|---|---|
| -f, --format | Required. drawio, mermaid, or plantuml |
| -o, --output | Write to file instead of stdout |
| -t, --type | Override detection: FLOWCHART, SEQUENCE, CLASS_DIAGRAM |
Library
Install:
npm install @cleveloper/dexUsage (TypeScript / Node.js):
import { readFileSync } from 'fs'
import { convert } from '@cleveloper/dex'
const raw = readFileSync('diagram.gliffy', 'utf-8')
const result = convert(raw, 'mermaid')
console.log(result.output)
// result.detectedType → DiagramType.FLOWCHART / SEQUENCE / CLASS_DIAGRAM
// result.warnings → string[]Override diagram type detection:
import { convert, DiagramType } from '@cleveloper/dex'
const result = convert(raw, 'plantuml', {
diagramType: DiagramType.SEQUENCE,
})All exported types:
import type { OutputFormat, ConvertOptions, ConvertResult, IRDiagram } from '@cleveloper/dex'
import { DiagramType } from '@cleveloper/dex'The library has no
fsdependency — pass raw JSON strings directly. File reading is the caller's responsibility, keeping the library compatible with browser bundlers.
Supported Formats
| Input | Output formats |
|---|---|
| .gliffy file or raw JSON string | Draw.io XML, Mermaid, PlantUML |
Diagram types auto-detected: flowchart, sequence diagram, class diagram.
Documentation
Full guides are in the docs/ directory (source repo):
| Guide | Description |
|---|---|
| Getting Started | New here? Start here — install Node.js, run first conversion, use as a library |
| CLI Usage | All flags, piping, stdin examples |
| Library Usage | Full TypeScript API reference |
| Local Setup | Dev environment, build, tests, npm link |
| Publishing | npm account setup, login, publish, common errors |
| Architecture | Pipeline, IR model, emitter design |
License
MIT
