# ansi-style-parser

> Parse ANSI colors and styles

Latest version **3.0.2** (published 2023-03-08) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install ansi-style-parser
pnpm add ansi-style-parser
yarn add ansi-style-parser
bun add ansi-style-parser
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 3.0.2 |
| Published | 2023-03-08 |
| First published | 2016-04-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | farskipper |
| Maintainers | farskipper |
| Keywords | ansi, styles, colors, parser |

## Links

- npm: https://www.npmjs.com/package/ansi-style-parser
- Repository: https://github.com/smallhelm/ansi-style-parser
- Homepage: https://github.com/smallhelm/ansi-style-parser#readme
- Issues: https://github.com/smallhelm/ansi-style-parser/issues
- npm.io page: https://npm.io/package/ansi-style-parser

## Dependencies (1)

- [ansi-regex](https://npm.io/package/ansi-regex.md) ^5.0.1

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 3.0.2 (latest) — 2023-03-08
- 3.0.1 — 2021-10-23
- 3.0.0 — 2020-08-08
- 2.0.0 — 2018-02-12
- 1.1.0 — 2017-03-25
- 1.0.1 — 2016-04-26
- 1.0.0 — 2016-04-26

## README

# ansi-style-parser

Parse ANSI colors and styles

## Install
`npm install ansi-style-parser`

## Usage

```js
var c = require('chalk');
var parser = require('ansi-style-parser');

var txt = 'Some ';
txt += c.bold.green('styled ' + c.underline.bgBlack('text') + c.red('!'));

console.log(parser(txt));
```
Output:
```js
[ { styles: [],
    text: 'Some ' },

  { styles: [ 'bold', 'green' ],
    text: 'styled ' },

  { styles: [ 'bold', 'green', 'underline', 'bgBlack' ],
    text: 'text' },

  { styles: [ 'bold', 'red' ],
    text: '!' } ]
```

## License
MIT

---
_Source: https://npm.io/package/ansi-style-parser · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
