ansi-html

WebJar for ansi-html

License

License

GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

ansi-html
Last Version

Last Version

0.0.7
Release Date

Release Date

Type

Type

jar
Description

Description

ansi-html
WebJar for ansi-html
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/Tjatse/ansi-html

Download ansi-html

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/ansi-html/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>ansi-html</artifactId>
    <version>0.0.7</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/ansi-html/
implementation 'org.webjars.npm:ansi-html:0.0.7'
// https://jarcasting.com/artifacts/org.webjars.npm/ansi-html/
implementation ("org.webjars.npm:ansi-html:0.0.7")
'org.webjars.npm:ansi-html:jar:0.0.7'
<dependency org="org.webjars.npm" name="ansi-html" rev="0.0.7">
  <artifact name="ansi-html" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='ansi-html', version='0.0.7')
)
libraryDependencies += "org.webjars.npm" % "ansi-html" % "0.0.7"
[org.webjars.npm/ansi-html "0.0.7"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

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

ansiHTML.setColors({
  reset: ['555', '666'], // FOREGROUND-COLOR or [FOREGROUND-COLOR] or [, BACKGROUND-COLOR] or [FOREGROUND-COLOR, BACKGROUND-COLOR]
  black: 'aaa',	// String
  red: 'bbb',
  green: 'ccc',
  yellow: 'ddd',
  blue: 'eee',
  magenta: 'fff',
  cyan: '999',
  lightgrey: '888',
  darkgrey: '777'
});

Reset

ansiHTML.reset();

Exposed Tags

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

Test

$ npm install -l
$ npm test

Versions

Version
0.0.7