# strip-ansi-control-characters

> Strips ANSI Control Characters from string or stream

Latest version **2.0.0** (published 2020-05-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install strip-ansi-control-characters
pnpm add strip-ansi-control-characters
yarn add strip-ansi-control-characters
bun add strip-ansi-control-characters
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2020-05-08 |
| First published | 2020-04-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Raees Iqbal |
| Maintainers | raeesbhatti |
| Keywords | ansi, console, terminal, remove, trim, strip, string, tty, escape, command-line, text, log, shell, clear, screen |

## Links

- npm: https://www.npmjs.com/package/strip-ansi-control-characters
- Repository: https://github.com/RaeesBhatti/strip-ansi-control-characters
- Homepage: https://github.com/RaeesBhatti/strip-ansi-control-characters#readme
- Issues: https://github.com/RaeesBhatti/strip-ansi-control-characters/issues
- npm.io page: https://npm.io/package/strip-ansi-control-characters

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 2.0.0 (latest) — 2020-05-08
- 1.0.1 — 2020-04-15

## README

# strip-ansi-control-characters
Strips ANSI Control Characters from string or stream.

## Use cases
If you spawn a child process in NodeJS with `inherit` or
`pipe` -> `process.std{out,err}` as `stdio`, the child process can clear
terminal screen or mangle information printed by your application.
This package allows you to show output from child process with all colors
and formatting but without those pesky clear screen or clear line
control characters.

## API

```js
function stripFromString(input: string): string
function stripFromStream(bufferEncoding: string = 'utf8'): stream.Duplex
```

## Usage
```js
const stripAnsiCc = require('strip-ansi-control-characters');
const child_process = require('child_process');

const ps = child_process.spawn('vuepress', ['dev'], {
  env: process.env,
  stdio: 'pipe',
});

ps.stdout.pipe(stripAnsiCc.stream()).pipe(process.stdout);
ps.stderr.pipe(stripAnsiCc.stream()).pipe(process.stderr);
```

## License
MIT license - file included in repo

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