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
- Host: GitHub
- URL: https://github.com/hua1995116/ansi-color-parse
- Owner: hua1995116
- License: mit
- Created: 2019-03-01T16:38:23.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-09-22T14:57:25.000Z (over 3 years ago)
- Last Synced: 2025-02-13T06:40:23.211Z (3 months ago)
- Topics: ansi, ansi-codes, ansi-colors
- Language: JavaScript
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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 蓝色的秋风