marked-terminal-renderer
v1.1.5
Published
marked terminal renderer
Downloads
6
Maintainers
Readme
marked-terminal-renderer
Terminal renderer marked extension.
Install
npm i marked-terminal-renderer
Usage
Typescript
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));
ESM
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));
Examples
node examples/example.mjs
Output:
Options
TBW
Features
- 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
:)