graph-easy
v0.0.0
Published
TypeScript port of Graph::Easy (0.76) — ASCII output compatible
Downloads
11
Readme
This is a port of https://metacpan.org/pod/Graph::Easy to TypeScript.
Read more here: https://tomisin.space/projects/graph-easy-ts/
Install
npm install graph-easyCLI (via npx)
npx graph-easy --help
echo "[ Bonn ] - car -> [ Berlin ]" | npx graph-easy
npx graph-easy graph.txt --svg --output=graph.svgLibrary usage (ESM)
import { Parser } from "graph-easy";
const graph = Parser.fromText("[ Bonn ] - car -> [ Berlin ]");
console.log(graph.asAscii());Library usage (CommonJS)
const { Parser } = require("graph-easy");
const graph = Parser.fromText("[ Bonn ] - car -> [ Berlin ]");
console.log(graph.asAscii());Note: external output formats like PNG/PDF use Graphviz (dot) under the hood, so Graphviz must be installed on your system for those.
