Bones/node_modules/has-ansi
SOUTHERNCO\x2mjbyrn 7efe7605b8 Template Upload
2017-05-17 13:45:25 -04:00
..
cli.js Template Upload 2017-05-17 13:45:25 -04:00
index.js Template Upload 2017-05-17 13:45:25 -04:00
package.json Template Upload 2017-05-17 13:45:25 -04:00
readme.md Template Upload 2017-05-17 13:45:25 -04:00

has-ansi Build Status

Check if a string has ANSI escape codes

Install

$ npm install --save has-ansi

Usage

var hasAnsi = require('has-ansi');

hasAnsi('\u001b[4mcake\u001b[0m');
//=> true

hasAnsi('cake');
//=> false

CLI

$ 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

License

MIT © Sindre Sorhus