An open API service indexing awesome lists of open source software.

https://github.com/hua1995116/ansi-color-parse

ansi-color-parse
https://github.com/hua1995116/ansi-color-parse

ansi ansi-codes ansi-colors

Last synced: 3 months ago
JSON representation

ansi-color-parse

Awesome Lists containing this project

README

        

# ansi-color-parse

# Usage
```
npm install ansi-color-parse

```

```javascript
const {parseAnsi, ansi2html, parseHtml} = require('ansi-color-parse');

const str = "\u001b[34mHello\u001b[39m World\u001b[31m!\u001b[39m";

const parseList = parseAnsi(str);

console.log(parseList);
// [ { foreground: 'blue', text: 'Hello' },
// { text: ' World' },
// { foreground: 'red', text: '!' } ]

console.log(ansi2html(parseList));
// Hello World!

console.log(parseHtml(str));
//Hello World!

```

# License

MIT

Copyright (c) 2018 蓝色的秋风