ansi-html-string
v1.2.6
Published
Convert ANSI escape sequences to html strings
Downloads
2
Readme
ansi-html-string
Convert ANSI escape sequences to html strings
Installation
npm install ansi-html-string
Usage
var { createConverter } = require('ansi-html-string');
var converter = createConverter()
var str = converter.toHtml('\x1b[35mhelloworld\x1b[0m');
Options
var str = createConverter({
minimumContrastRatio: 4.5,
theme: {
background: "#23272e", // default background
foreground: "#abb2bf", // default foreground
red: "#000000",
...
},
}).toHtml('\x1b[35mhelloworld\x1b[0m');
Generate simple html template
var str = createConverter().toDemo('\x1b[31;1;3;4;7;9mhelloworld\x1b[0m');