aboutsummaryrefslogtreecommitdiff
path: root/bin/g2g
diff options
context:
space:
mode:
authorRuben Beltran del Rio <ruben@unlimited.pizza>2020-09-20 18:41:08 +0200
committerRuben Beltran del Rio <ruben@unlimited.pizza>2020-09-20 18:41:08 +0200
commita597c68201245e9e7b7d3d2ef62134588581ed3f (patch)
treeb8ecfc6b3ea2bb7efccea17e7439fb162ce5beb0 /bin/g2g
Initial versionHEADmain
Diffstat (limited to 'bin/g2g')
-rwxr-xr-xbin/g2g22
1 files changed, 22 insertions, 0 deletions
diff --git a/bin/g2g b/bin/g2g
new file mode 100755
index 0000000..ed8e312
--- /dev/null
+++ b/bin/g2g
@@ -0,0 +1,22 @@
+#!/usr/bin/env node
+
+'use strict';
+
+const GraphvizToGrafn = require('..');
+
+const stdin = process.stdin;
+let graphvizSource = '';
+
+stdin.setEncoding('utf8');
+
+stdin.on('data', function (chunk) {
+
+ graphvizSource += chunk;
+});
+
+stdin.on('end', function () {
+
+ console.log(GraphvizToGrafn(graphvizSource));
+});
+
+stdin.on('error', console.error);