ansi-html

ansi-html NPM version Build Status

An elegant lib that converts the chalked (ANSI) text to HTML.

Coverage

  • All styles of chalk (100%) and colors.

  • There are over 150 randomized test cases under test.

Installation

$ npm install ansi-html

Usage

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?