|
|
3 年之前 | |
|---|---|---|
| .. | ||
| cli.js | 3 年之前 | |
| index.js | 3 年之前 | |
| package.json | 3 年之前 | |
| readme.md | 3 年之前 | |
Check if a string has ANSI escape codes
$ npm install --save has-ansi
var hasAnsi = require('has-ansi');
hasAnsi('\u001b[4mcake\u001b[0m');
//=> true
hasAnsi('cake');
//=> false
$ npm install --global has-ansi
$ has-ansi --help
Usage
$ has-ansi <string>
$ echo <string> | has-ansi
Exits with code 0 if input has ANSI escape codes and 1 if not
MIT © Sindre Sorhus