JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5796012
  • Score
    100M100P100Q206683F
  • License Apache, Version 2.0

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

Package Exports

  • ansi-html

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ansi-html) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ansi-html NPM version Build Status

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

Coverage

All styles of chalk. 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 ansiHTML   = require('../'),
    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.

Exposed Tags

var openTags = ansiHTML.tags.open;
var openTags = ansiHTML.tags.close;

Test

$ npm install -l
$ npm test