UNPKG

diagrams

Version:

Generate Flowcharts, Network Sequence, Dot, and Railroad Diagrams

32 lines (25 loc) 645 B
#!/usr/bin/env node var program = require('commander'), inputFilePath, outputSVGFilePath, flowchart = require('../src/flowchart/flowchart'), fs = require('fs'); program .parse(process.argv); // There must be at least an input file if(process.argv.length<3){ console.log('Error: No input file provided') process.exit(1); } inputFilePath = process.argv[2]; if(process.argv[3]){ outputSVGFilePath = process.argv[3]; } else { outputSVGFilePath = inputFilePath + ".svg"; } flowchart(inputFilePath, outputSVGFilePath, function(err){ if(err){ console.error(err); process.exit(1); } });