https://github.com/chalk/has-ansi-cli
Check if a string has ANSI escape codes
https://github.com/chalk/has-ansi-cli
Last synced: 7 months ago
JSON representation
Check if a string has ANSI escape codes
- Host: GitHub
- URL: https://github.com/chalk/has-ansi-cli
- Owner: chalk
- License: mit
- Created: 2015-06-30T16:32:35.000Z (about 11 years ago)
- Default Branch: main
- Last Pushed: 2021-09-13T18:26:15.000Z (almost 5 years ago)
- Last Synced: 2025-06-05T05:33:40.462Z (about 1 year ago)
- Language: JavaScript
- Size: 11.7 KB
- Stars: 10
- Watchers: 7
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# has-ansi-cli
> Check if a string has [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code)
## Install
```
$ npm install --global has-ansi-cli
```
## Usage
```
$ has-ansi --help
Usage
$ has-ansi
$ echo | has-ansi
Example
$ ls --color | has-ansi && echo 'has ansi'
Exits with code 0 if input has ANSI escape codes and 1 if not
```
## Related
- [has-ansi](https://github.com/chalk/has-ansi) - API for this module
## Maintainers
- [Sindre Sorhus](https://github.com/sindresorhus)
- [Josh Junon](https://github.com/qix-)