ansi-html
An elegant lib that converts the chalked (ANSI) text to HTML.
Coverage
There are over 150 randomized test cases under
test.
Installation
$ npm install ansi-htmlUsage
var ansiHTML = require('ansi-html');
var str = ansiHTML('[ANSI_TEXT]');e.g.:
var chalk = require('chalk');
var str = chalk.bold.red('foo') + ' bar';
console.log('[ANSI]', str)
console.log('[HTML]', ansiHTML(str));See complete examples under test / examples directory.
Set Colors
Reset
Exposed Tags
Test
Last updated
Was this helpful?