A small TypeScript renderer for nwdiag-compatible network diagrams. Pure JS, browser-native, no Python/Java backend required.
import { renderFromSource } from "simplediag";
const { svg } = renderFromSource(`
nwdiag {
network dmz {
address = "10.0.0.0/24";
web01 [address = ".10"];
web02 [address = ".11"];
}
}
`);- Package:
packages/simplediag/— the library, MIT-licensed. Read its README for the API surface and SUPERSET.md for the additions over standard nwdiag. - Demo:
packages/demo/— Vite app with a textarea- render button.
pnpm --filter simplediag-demo dev.
- render button.
This is a pnpm workspace. Workspace commands at the root delegate to the package:
pnpm install
pnpm test # runs simplediag's vitest suite
pnpm build # ESM + CJS + DTS via tsup
pnpm typecheck
pnpm check:license # verifies source and license isolation rules
See AGENTS.md for repository guidance and license isolation rules.
MIT.