Gathering detailed insights and metrics for ansi-to-html
Gathering detailed insights and metrics for ansi-to-html
Gathering detailed insights and metrics for ansi-to-html
Gathering detailed insights and metrics for ansi-to-html
npm install ansi-to-html
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
356 Stars
243 Commits
48 Forks
8 Watching
6 Branches
16 Contributors
Updated on 19 Nov 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-7.9%
325,986
Compared to previous day
Last week
2.2%
1,829,246
Compared to previous week
Last month
6.7%
7,959,037
Compared to previous month
Last year
-43.3%
108,268,728
Compared to previous year
1
8
This was originally a port of the ansi to html converter from bcat to JavaScript. It has since undergone quite a lot of modification.
It has a few additions:
toHtml()
.\x1b[K
) is dropped from the output.1npm install ansi-to-html
1var Convert = require('ansi-to-html'); 2var convert = new Convert(); 3 4console.log(convert.toHtml('\x1b[30mblack\x1b[37mwhite')); 5 6/* 7 prints: 8 <span style="color:#000">black<span style="color:#AAA">white</span></span> 9*/
When using ansi-to-html from the command line the stream option is set to true
.
Other options can be provided. See ansi-to-html -h
for more detail.
1ansi-to-html the_filename
1git log | ansi-to-html
Options can be be passed to the constructor to customize behaviour.
fg <CSS color values>
. The default foreground color used when reset color codes are encountered.
bg <CSS color values>
. The default background color used when reset color codes are encountered.
newline true
or false
. Convert newline characters to <br/>
.
escapeXML true
or false
. Generate HTML/XML entities.
stream true
or false
. Save style state across invocations of toHtml()
.
colors Object
/Array
(with values 0 - 255 containing CSS color values). Can override specific colors or the entire ANSI palette
1{ 2 fg: '#FFF', 3 bg: '#000', 4 newline: false, 5 escapeXML: false, 6 stream: false 7}
Once you have the git repository cloned, install the dependencies:
1cd ansi-to-html 2npm install
1npm run lint
1npm test
/lib
directory).1npm run test:watch
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
7 existing vulnerabilities detected
Details
Reason
Found 5/21 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
Reason
project is not fuzzed
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