Sha256: b86626da9fad430152a1ba83878435da5bb083aa353e4aac7ba0cc688cf88dda

Contents?: true

Size: 677 Bytes

Versions: 30

Compression:

Stored size: 677 Bytes

Contents

# has-ansi [![Build Status](https://travis-ci.org/sindresorhus/has-ansi.svg?branch=master)](https://travis-ci.org/sindresorhus/has-ansi)

> Check if a string has [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code)


## Install

```sh
$ npm install --save has-ansi
```


## Usage

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

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

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


## CLI

```sh
$ 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](http://sindresorhus.com)

Version data entries

30 entries across 14 versions & 4 rubygems

Version Path
gulp_assets-1.0.0.pre.5 template/node_modules/gulp-rev-replace/node_modules/gulp-util/node_modules/chalk/node_modules/has-ansi/readme.md
gulp_assets-1.0.0.pre.5 template/node_modules/gulp-livereload/node_modules/chalk/node_modules/has-ansi/readme.md
gulp_assets-1.0.0.pre.4 template/node_modules/gulp-rev-replace/node_modules/gulp-util/node_modules/chalk/node_modules/has-ansi/readme.md
gulp_assets-1.0.0.pre.4 template/node_modules/gulp-livereload/node_modules/chalk/node_modules/has-ansi/readme.md
gulp_assets-1.0.0.pre.3 template/node_modules/gulp-livereload/node_modules/chalk/node_modules/has-ansi/readme.md
gulp_assets-1.0.0.pre.3 template/node_modules/gulp-rev-replace/node_modules/gulp-util/node_modules/chalk/node_modules/has-ansi/readme.md
entangled-0.0.16 spec/dummy/public/node_modules/bower/node_modules/insight/node_modules/chalk/node_modules/has-ansi/readme.md
entangled-0.0.16 spec/dummy/public/node_modules/bower/node_modules/chalk/node_modules/has-ansi/readme.md
entangled-0.0.15 spec/dummy/public/node_modules/bower/node_modules/insight/node_modules/chalk/node_modules/has-ansi/readme.md
entangled-0.0.15 spec/dummy/public/node_modules/bower/node_modules/chalk/node_modules/has-ansi/readme.md
entangled-0.0.14 spec/dummy/public/node_modules/bower/node_modules/insight/node_modules/chalk/node_modules/has-ansi/readme.md
entangled-0.0.14 spec/dummy/public/node_modules/bower/node_modules/chalk/node_modules/has-ansi/readme.md
entangled-0.0.13 spec/dummy/public/node_modules/bower/node_modules/insight/node_modules/chalk/node_modules/has-ansi/readme.md
entangled-0.0.13 spec/dummy/public/node_modules/bower/node_modules/chalk/node_modules/has-ansi/readme.md
entangled-0.0.12 spec/dummy/public/node_modules/bower/node_modules/insight/node_modules/chalk/node_modules/has-ansi/readme.md
entangled-0.0.12 spec/dummy/public/node_modules/bower/node_modules/chalk/node_modules/has-ansi/readme.md
entangled-0.0.11 spec/dummy/public/node_modules/bower/node_modules/insight/node_modules/chalk/node_modules/has-ansi/readme.md
entangled-0.0.11 spec/dummy/public/node_modules/bower/node_modules/chalk/node_modules/has-ansi/readme.md
entangled-0.0.10 spec/dummy/public/node_modules/bower/node_modules/insight/node_modules/chalk/node_modules/has-ansi/readme.md
entangled-0.0.10 spec/dummy/public/node_modules/bower/node_modules/chalk/node_modules/has-ansi/readme.md