# strip-ansi-stream

> Strip ANSI escape codes

Latest version **2.0.1** (published 2021-09-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install strip-ansi-stream
pnpm add strip-ansi-stream
yarn add strip-ansi-stream
bun add strip-ansi-stream
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2021-09-13 |
| First published | 2017-09-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | >=12 |
| Dependencies | 2 |
| Unpacked size | 3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 40 |
| Maintainers | sindresorhus, qix |
| Keywords | strip, trim, remove, ansi, styles, color, colour, colors, terminal, console, string, tty, escape, formatting, rgb, 256, shell, xterm, log, logging, command-line, text, stream |

## Links

- npm: https://www.npmjs.com/package/strip-ansi-stream
- Repository: https://github.com/chalk/strip-ansi-stream
- Homepage: https://github.com/chalk/strip-ansi-stream#readme
- Issues: https://github.com/chalk/strip-ansi-stream/issues
- Funding: https://github.com/chalk/strip-ansi-stream?sponsor=1
- npm.io page: https://npm.io/package/strip-ansi-stream

## Dependencies (2)

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

## Alternatives

- [postcss-color-hex-alpha](https://npm.io/package/postcss-color-hex-alpha.md) — 6.4M weekly downloads
- [randomcolor](https://npm.io/package/randomcolor.md) — 348.0K weekly downloads
- [bows](https://npm.io/package/bows.md) — 1.3K weekly downloads
- [ep_prefer_color_scheme](https://npm.io/package/ep_prefer_color_scheme.md) — 260 weekly downloads
- [coc-yank](https://npm.io/package/coc-yank.md) — 61 weekly downloads

## Recent versions

- 2.0.1 (latest) — 2021-09-13
- 2.0.0 — 2021-04-16
- 1.0.0 — 2017-09-20

## README

# strip-ansi-stream

> Strip [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code)

## Install

```
$ npm install strip-ansi-stream
```

## Usage

```js
import stripAnsiStream from 'strip-ansi-stream';

const stream = stripAnsiStream();

stream.on('data', data => {
	console.log(data);
	//=> 'Unicorn'
	//=> 'bar'
})

stream.write('\u001B[4mUnicorn\u001B[0m');
stream.end('\u001B[0;33;49;3;9;4mbar\u001B[0m');
```

## API

### stripAnsiStream()

Returns a [`Transform` stream](https://nodejs.org/api/stream.html#stream_class_stream_transform) that strips ANSI escape codes.

## Related

- [strip-ansi](https://github.com/chalk/strip-ansi) - Non-streaming version of this module
- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes
- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes
- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right

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