Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Tjatse committed Dec 15, 2014
1 parent 66e22b3 commit 53ee2e6
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
ansi-html [![NPM version](https://badge.fury.io/js/ansi-html.svg)](http://badge.fury.io/js/ansi-html) [![Build Status](https://travis-ci.org/Tjatse/ansi-html.svg?branch=master)](https://travis-ci.org/Tjatse/ansi-html)
=========
An elegant lib that converts the chalked (ANSI) text to HTML.

# Coverage
All styles of [chalk](https://github.com/sindresorhus/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.:
```javascript
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
```

0 comments on commit 53ee2e6

Please sign in to comment.