1 | # strip-ansi [![Build Status](https://travis-ci.org/sindresorhus/strip-ansi.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-ansi)
|
2 |
|
3 | > Strip [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code)
|
4 |
|
5 |
|
6 | ## Install
|
7 |
|
8 | ```sh
|
9 | $ npm install --save strip-ansi
|
10 | ```
|
11 |
|
12 |
|
13 | ## Usage
|
14 |
|
15 | ```js
|
16 | var stripAnsi = require('strip-ansi');
|
17 |
|
18 | stripAnsi('\x1b[4mcake\x1b[0m');
|
19 | //=> 'cake'
|
20 | ```
|
21 |
|
22 |
|
23 | ## CLI
|
24 |
|
25 | ```sh
|
26 | $ npm install --global strip-ansi
|
27 | ```
|
28 |
|
29 | ```sh
|
30 | $ strip-ansi --help
|
31 |
|
32 | Usage
|
33 | $ strip-ansi <input-file> > <output-file>
|
34 | $ cat <input-file> | strip-ansi > <output-file>
|
35 |
|
36 | Example
|
37 | $ strip-ansi unicorn.txt > unicorn-stripped.txt
|
38 | ```
|
39 |
|
40 |
|
41 | ## License
|
42 |
|
43 | MIT © [Sindre Sorhus](http://sindresorhus.com)
|