Terminal renderer marked extension.
npm i marked-terminal-renderer
import terminalRenderer from 'marked-terminal-renderer';
import * as marked from 'marked';
import { readFileSync } from 'fs';
marked.use(terminalRenderer());
const src = readFileSync(__dirname + 'example.md').toString();
console.log(marked(src));
import terminalRenderer from 'marked-terminal-renderer';
import marked from 'marked';
import { readFileSync } from 'fs';
marked.use(terminalRenderer());
// there is no __dirname in ESM (this is not a node environment)
const src = readFileSync(new URL('example.md', import.meta.url)).toString();
console.log(marked(src));
node examples/example.mjs
Output:
TBW
- Colors - thanks to chalk
- Tables - thanks to cli-table3
- Wrapping - thanks to word-wrap
- Code Highlighting - thanks to cli-highlight
- Emoji - thanks to node-emoji
:)