3 Converts graphviz .dot files to [Grafn][grafn] javascript code. This lets you
4 define your application flow using a diagram editor first, and then fill out
12 const Fs = require('fs/promises');
13 const GraphvizToGrafn = require('grafn-to-graphviz');
15 async function convert() {
16 const graphvizCode = await Fs.read('/path/to/graphviz.dot');
17 const grafnCode = await GraphvizToGrafn(graphvizCode.toString());
19 console.log(grafnCode); // will print the JS code
26 $ npm install -g graphviz-to-grafn
27 $ cat ./path/to/graphviz.dot | g2g > grafn_code.js
30 [grafn]: https://gitlab.com/rbdr/grafn