const fs = require('fs'); const mjAPI = require("mathjax-node"); mjAPI.config({ MathJax: {} }); mjAPI.start(); let data = fs.readFileSync(0, 'utf-8'); mjAPI.typeset({ math: data, format: "TeX", mml: true, }, function (data) { if (!data.errors) {console.log(data.mml)} });