()
| 66 | } |
| 67 | |
| 68 | function readInput() { |
| 69 | let input = ""; |
| 70 | |
| 71 | if (options.input) { |
| 72 | fs.readFile(options.input, "utf-8", function(err, data) { |
| 73 | if (err) {throw err;} |
| 74 | input = data.toString(); |
| 75 | writeOutput(input); |
| 76 | }); |
| 77 | } else { |
| 78 | process.stdin.on("data", function(chunk) { |
| 79 | input += chunk.toString(); |
| 80 | }); |
| 81 | |
| 82 | process.stdin.on("end", function() { |
| 83 | writeOutput(input); |
| 84 | }); |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | function writeOutput(input) { |
| 89 | // --format specifies the KaTeX output |
no test coverage detected