Gathering detailed insights and metrics for @daguej/markdown-it-terminal
Gathering detailed insights and metrics for @daguej/markdown-it-terminal
Gathering detailed insights and metrics for @daguej/markdown-it-terminal
Gathering detailed insights and metrics for @daguej/markdown-it-terminal
Markdown-it plugin providing ANSI output for terminal
npm install @daguej/markdown-it-terminal
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
23 Stars
72 Commits
11 Forks
1 Watchers
5 Branches
6 Contributors
Updated on Dec 09, 2023
Latest Version
0.2.0
Package Id
@daguej/markdown-it-terminal@0.2.0
Unpacked Size
22.72 kB
Size
6.75 kB
File Count
8
NPM Version
6.14.4
Node Version
12.16.2
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
5
This is a plugin to provide ansi terminal output for markdown-it. It is heavily inspired by marked-terminal, a terminal renderer for the marked library.
This library is not officially supported by markdown-it.
This forked release adds #13 to upstream v0.1.1.
npm install markdown-it markdown-it-terminal
markdown-it
provides a method for extending it with plugins.
1var markdown = require('markdown-it'); 2var terminal = require('markdown-it-terminal'); 3 4markdown.use(terminal);
You can override the default options if you choose.
1var styles = require('ansi-styles'); 2var markdown = require('markdown-it'); 3var terminal = require('markdown-it-terminal'); 4 5var options = { 6 styleOptions: { 7 code: styles.green 8 } 9} 10markdown.use(terminal, options); 11// inline code now prints in green instead of the default yellow
markdown-it-terminal
takes several options, most of which are to override existing defaults.
1var options = { 2 styleOptions:{}, 3 highlight: require('cardinal').highlight, 4 unescape: true, 5 indent: ' ' 6}
Styles are defined per token, and make use of the ansi-styles
library, which provides a number of open and close values for ansi codes.
In the most basic implementation, you can simply provide a supported style like so:
1var styles = require('ansi-styles'); 2 3var options = { 4 styleOptions: { 5 code: styles.green 6 } 7}
markdown-it-terminal
exposes a utility method to build compound styles, using an array of style names (must be supported by ansi-styles
).
1var styles = require('ansi-styles'); 2var terminal = require('markdown-it-terminal'); 3 4var options = { 5 styleOptions: { 6 code: terminal.compoundStyle(['green','underline']) 7 } 8}
The following tokens can be overridden through styleOptions:
Highlight function to parse code blocks. Should be a function that takes a string and outputs a formatted string.
Unescape content, true
by default.
Indent all content under a heading (h1
..h6
) using this string. With indent: ' '
(two spaces):
Markdown | Rendered |
---|---|
# Heading 1 | Heading 1 |
markdown-it-terminal
uses the cardinal library
for code highlight support by default.
Because ansi is not supported on cmd.exe, markdown-it-terminal
only works on Windows shells with ansi support.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 2/10 approved changesets -- score normalized to 2
Reason
8 existing vulnerabilities detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More