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

Function writeOutput

cli.js:88–104  ·  view source on GitHub ↗
(input)

Source from the content-addressed store, hash-verified

86}
87
88function writeOutput(input) {
89 // --format specifies the KaTeX output
90 const outputFile = options.output;
91 options.output = options.format;
92
93 const output = katex.renderToString(input, options) + "\n";
94
95 if (outputFile) {
96 fs.writeFile(outputFile, output, function(err) {
97 if (err) {
98 return console.log(err);
99 }
100 });
101 } else {
102 console.log(output);
103 }
104}
105
106if (require.main !== module) {
107 module.exports = program;

Callers 1

readInputFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected