Skip to content

Lellansin/color2html

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

color2html.js

Convert ANSII color characters to html. With this module, you can convert your colorful log into clear html.

Example

var color2html = require('color2html');
var str = '\033[32mhello, world\033[39m';
console.log(color2html(str));
// <font color="green">hello, world</font>

str = '\033[1m\033[32mhello, \033[39m\033[22m\033[34mworld\033[39m';
console.log(color2html(str));
// <b><font color="green">hello, </font></b><font color="blue">world</font>

str = '\033[4mhello world\033[24m';
console.log(color2html(str));
// <font style="text-decoration: underline;">hello world</font>

About

Convert ANSII color characters to html

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published