jack e1a2621c78 update 2 years ago
..
cli.js e1a2621c78 update 2 years ago
index.js e1a2621c78 update 2 years ago
package.json e1a2621c78 update 2 years ago
readme.md e1a2621c78 update 2 years ago

readme.md

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