Gathering detailed insights and metrics for marked-terminal
Gathering detailed insights and metrics for marked-terminal
Gathering detailed insights and metrics for marked-terminal
Gathering detailed insights and metrics for marked-terminal
A Renderer for the marked project. Allowing you to render Markdown to print to your Terminal
npm install marked-terminal
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
426 Stars
323 Commits
57 Forks
5 Watching
3 Branches
30 Contributors
Updated on 25 Nov 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
6.6%
572,689
Compared to previous day
Last week
6.6%
3,027,775
Compared to previous week
Last month
25.6%
11,540,656
Compared to previous month
Last year
25%
102,669,143
Compared to previous year
1
Custom Renderer for marked allowing for printing Markdown to the Terminal. Supports pretty tables, syntax highlighting for javascript, and overriding all colors and styles.
Could for instance be used to print usage information.
1npm install marked marked-terminal
1import { marked } from 'marked'; 2import { markedTerminal } from 'marked-terminal'; 3 4marked.use(markedTerminal([options][, highlightOptions])); 5 6marked.parse('# Hello \n This is **markdown** printed in the `terminal`');
1const marked = require('marked'); 2const TerminalRenderer = require('marked-terminal'); 3 4marked.setOptions({ 5 // Define custom renderer 6 renderer: new TerminalRenderer() 7}); 8 9// Show the parsed data 10console.log( 11 marked('# Hello \n This is **markdown** printed in the `terminal`') 12);
This will produce the following:
Also have support for syntax highlighting using cli-highlight. You can override highlighting defaults by passing in settings as the second argument for TerminalRenderer.
Having the following markdown input:
```js var foo = function(bar) { console.log(bar); }; foo('Hello'); ```
...we will convert it into terminal format:
1// Show the parsed data 2console.log(marked(exampleSource));
This will produce the following:
Constructur: new TerminalRenderer([options][, highlightOptions])
options
Optional Used to override default styling.
Default values are:
1var defaultOptions = { 2 // Colors 3 code: chalk.yellow, 4 blockquote: chalk.gray.italic, 5 html: chalk.gray, 6 heading: chalk.green.bold, 7 firstHeading: chalk.magenta.underline.bold, 8 hr: chalk.reset, 9 listitem: chalk.reset, 10 table: chalk.reset, 11 paragraph: chalk.reset, 12 strong: chalk.bold, 13 em: chalk.italic, 14 codespan: chalk.yellow, 15 del: chalk.dim.gray.strikethrough, 16 link: chalk.blue, 17 href: chalk.blue.underline, 18 19 // Formats the bulletpoints and numbers for lists 20 list: function (body, ordered) {/* ... */}, 21 22 // Reflow and print-out width 23 width: 80, // only applicable when reflow is true 24 reflowText: false, 25 26 // Should it prefix headers? 27 showSectionPrefix: true, 28 29 // Whether or not to undo marked escaping 30 // of enitities (" -> " etc) 31 unescape: true, 32 33 // Whether or not to show emojis 34 emoji: true, 35 36 // Options passed to cli-table3 37 tableOptions: {}, 38 39 // The size of tabs in number of spaces or as tab characters 40 tab: 3 // examples: 4, 2, \t, \t\t 41 42 image: function (href, title, text) {} // function for overriding the default image handling. 43};
1marked.setOptions({ 2 renderer: new TerminalRenderer({ 3 codespan: chalk.underline.magenta 4 }) 5});
highlightOptions
Options passed into cli-highlight. See readme there to see what options to pass.
See more examples
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
13 commit(s) and 3 issue activity found in the last 90 days -- score normalized to 10
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
1 existing vulnerabilities detected
Details
Reason
Found 3/9 approved changesets -- score normalized to 3
Reason
dependency not pinned by hash detected -- score normalized to 2
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
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 2024-11-18
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