Skip to content

Commit

Permalink
Merge pull request #48 from vidartf/ts-example
Browse files Browse the repository at this point in the history
Typescript example
  • Loading branch information
drudru committed Apr 4, 2018
2 parents 985a41b + 796668e commit acf2a67
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Readme.md
Expand Up @@ -54,6 +54,20 @@ For example, turn this terminal output:

More examples are in the 'examples' directory in the repo.

## Typescript Example

```TypeScript
import {
default as AnsiUp
} from 'ansi_up';

const ansi_up = new AnsiUp();

const txt = "\n\n\x1B[1;33;40m 33;40 \x1B[1;33;41m 33;41 \x1B[1;33;42m 33;42 \x1B[1;33;43m 33;43 \x1B[1;33;44m 33;44 \x1B[1;33;45m 33;45 \x1B[1;33;46m 33;46 \x1B[1m\x1B[0\n\n\x1B[1;33;42m >> Tests OK\n\n"

let html = ansi_up.ansi_to_html(txt);
```

## Installation

$ npm install ansi_up
Expand Down

0 comments on commit acf2a67

Please sign in to comment.