Markdown-it plugin providing ANSI output for terminal
Installations
npm install markdown-it-terminal
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
16.14.2
NPM Version
8.5.0
Score
96.8
Supply Chain
98.6
Quality
74.8
Maintenance
100
Vulnerability
99.3
License
Releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
trabus
Download Statistics
Total Downloads
55,431,474
Last Day
3,929
Last Week
141,753
Last Month
583,673
Last Year
7,274,603
GitHub Statistics
MIT License
23 Stars
72 Commits
11 Forks
2 Watchers
5 Branches
6 Contributors
Updated on Dec 09, 2023
Bundle Size
172.51 kB
Minified
44.67 kB
Minified + Gzipped
Package Meta Information
Latest Version
0.4.0
Package Id
markdown-it-terminal@0.4.0
Unpacked Size
22.74 kB
Size
6.70 kB
File Count
8
NPM Version
8.5.0
Node Version
16.14.2
Total Downloads
Cumulative downloads
Total Downloads
55,431,474
Last Day
-18.4%
3,929
Compared to previous day
Last Week
-4.7%
141,753
Compared to previous week
Last Month
33.8%
583,673
Compared to previous month
Last Year
1.9%
7,274,603
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
4
Peer Dependencies
1
Dev Dependencies
3
markdown-it-terminal
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.
Install
npm install markdown-it markdown-it-terminal
Usage
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
Options
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}
styleOptions
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:
- code
- blockquote
- html
- heading
- firstHeading
- hr
- listitem
- table
- paragraph
- strong
- em
- codespan
- del
- link
- href
highlight
Highlight function to parse code blocks. Should be a function that takes a string and outputs a formatted string.
unescape
Unescape content, true
by default.
indent
Indent all content under a heading (h1
..h6
) using this string. With indent: ' '
(two spaces):
Markdown | Rendered |
---|---|
# Heading 1 | Heading 1 |
Highlighting
markdown-it-terminal
uses the cardinal library
for code highlight support by default.
Windows Support
Because ansi is not supported on cmd.exe, markdown-it-terminal
only works on Windows shells with ansi support.
![Empty State](/_next/static/media/empty.e5fae2e5.png)
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
7 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-2j2x-2gpw-g8fm
- Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
Reason
Found 2/10 approved changesets -- score normalized to 2
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
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 23 are checked with a SAST tool
Score
2.4
/10
Last Scanned on 2025-02-10
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 MoreOther packages similar to markdown-it-terminal
@auburnsummer/markdown-it-terminal
for my internal use. markdown-it-terminal with cardinal removed
@daguej/markdown-it-terminal
Plugin for markdown-it to parse and output markdown formatted for the terminal
cli-manual
parse markdown input, making it more readable in the terminal
readme_generator_heeringdesign
A command-line README generator. It is run in terminal and poses questions to the user, and the responses are formatted into markdown text.