Skip to content

Commit

Permalink
add example
Browse files Browse the repository at this point in the history
  • Loading branch information
Tjatse committed Dec 15, 2014
1 parent b5f6fbd commit 369af64
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,23 @@ ansi-html [![NPM version](https://badge.fury.io/js/ansi-html.svg)](http://badge.
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`.
- All styles of [chalk](https://github.com/sindresorhus/chalk) (100%).
- 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]);
```javascript
var ansiHTML = require('ansi-html');
var str = ansiHTML('[ANSI_TEXT]');
```

e.g.:
```javascript
var ansiHTML = require('../'),
chalk = require('chalk');
var chalk = require('chalk');

var str = chalk.bold.red('foo') + ' bar';
console.log('[ANSI]', str)
Expand All @@ -32,7 +31,7 @@ See complete examples under `test` / `examples` directory.
# Exposed Tags
```
var openTags = ansiHTML.tags.open;
var openTags = ansiHTML.tags.close;
var closeTags = ansiHTML.tags.close;
```

# Test
Expand Down

0 comments on commit 369af64

Please sign in to comment.