By Alex

highlightCode.js

Javascript 486 Bytes 19 19 days ago
const hljs = require("highlight.js"); const process = require("process"); var readline = require('readline'); const lang = process.env.LANG; var rl = readline.createInterface({ input: process.stdin, output: process.stdout, terminal: false }); rl.on('line', function (line) { console.log(line, "i hate this aaaaaa---------------------------\n"); const html = hljs.highlight(line, { language: lang }); console.log(html); process.exit(0); })