2019-09-18 08:11:16 +00:00
|
|
|
# strip-ansi [![Build Status](https://travis-ci.org/chalk/strip-ansi.svg?branch=master)](https://travis-ci.org/chalk/strip-ansi)
|
|
|
|
|
2019-11-22 09:43:37 +00:00
|
|
|
> Strip [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code)
|
2019-09-18 08:11:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
## Install
|
|
|
|
|
|
|
|
```
|
2019-11-22 09:43:37 +00:00
|
|
|
$ npm install --save strip-ansi
|
2019-09-18 08:11:16 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
```js
|
2019-11-22 09:43:37 +00:00
|
|
|
var stripAnsi = require('strip-ansi');
|
2019-09-18 08:11:16 +00:00
|
|
|
|
2019-11-22 09:43:37 +00:00
|
|
|
stripAnsi('\u001b[4mcake\u001b[0m');
|
|
|
|
//=> 'cake'
|
2019-09-18 08:11:16 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## Related
|
|
|
|
|
|
|
|
- [strip-ansi-cli](https://github.com/chalk/strip-ansi-cli) - CLI for 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
|
|
|
|
|
|
|
|
|
|
|
|
## License
|
|
|
|
|
2019-11-22 09:43:37 +00:00
|
|
|
MIT © [Sindre Sorhus](http://sindresorhus.com)
|