Skip to content

ziv/marked-terminal-renderer

Repository files navigation

marked-terminal-renderer

Terminal renderer marked extension.

CI CodeQL

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:

output

Options

TBW

Features

downloads semantic-release

:)