diff options
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..7316693 --- /dev/null +++ b/README.md @@ -0,0 +1,30 @@ +# Graphviz to Grafn + +Converts graphviz .dot files to [Grafn][grafn] javascript code. This lets you +define your application flow using a diagram editor first, and then fill out +the functionality. + +## How can I use it? + +### As a Library + +```javascript +const Fs = require('fs/promises'); +const GraphvizToGrafn = require('grafn-to-graphviz'); + +async function convert() { + const graphvizCode = await Fs.read('/path/to/graphviz.dot'); + const grafnCode = await GraphvizToGrafn(graphvizCode.toString()); + + console.log(grafnCode); // will print the JS code +} +``` + +### As a Binary + +``` +$ npm install -g graphviz-to-grafn +$ cat ./path/to/graphviz.dot | g2g > grafn_code.js +``` + +[grafn]: https://gitlab.com/rbdr/grafn |