You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

marked-terminal

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

marked-terminal

A custom render for marked to output to the Terminal

7.3.0
latest
Source
npm
Version published
Weekly downloads
2.7M
-4.12%
Maintainers
1
Weekly downloads
 
Created

What is marked-terminal?

The marked-terminal package is a custom renderer for the marked library, allowing Markdown content to be rendered in the terminal. It converts Markdown into ANSI escape codes to display styled text and other elements directly in the command line interface. This is particularly useful for CLI applications that want to display rich text content or documentation in a more readable and visually appealing format.

What are marked-terminal's main functionalities?

Rendering Headers

This feature allows the rendering of Markdown headers in the terminal with appropriate styling to distinguish them from other text.

const TerminalRenderer = require('marked-terminal');
const marked = require('marked');

marked.setOptions({
  renderer: new TerminalRenderer()
});

console.log(marked('# Header 1'));
// This will output a styled Header 1 in the terminal

Rendering Links

This feature enables the display of clickable links in the terminal, making it easier to reference web resources directly from the command line output.

const TerminalRenderer = require('marked-terminal');
const marked = require('marked');

marked.setOptions({
  renderer: new TerminalRenderer()
});

console.log(marked('[GitHub](https://github.com)'));
// This will output the text 'GitHub' as a clickable link in the terminal, if supported, or display the URL next to the text.

Rendering Lists

This feature supports the rendering of bullet and numbered lists, enhancing the readability of list information in the terminal.

const TerminalRenderer = require('marked-terminal');
const marked = require('marked');

marked.setOptions({
  renderer: new TerminalRenderer()
});

console.log(marked('- Item 1\n- Item 2'));
// This will output a styled list with 'Item 1' and 'Item 2' as its elements.

Other packages similar to marked-terminal

Keywords

marked

FAQs

Package last updated on 28 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts