MCPcopy Create free account
hub / github.com/KaTeX/KaTeX / readInput

Function readInput

cli.js:68–86  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

66}
67
68function 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
88function writeOutput(input) {
89 // --format specifies the KaTeX output

Callers 1

splitMacrosFunction · 0.85

Calls 1

writeOutputFunction · 0.85

Tested by

no test coverage detected