Skip to content
/ has-ansi Public

Check if a string has ANSI escape codes

License

Notifications You must be signed in to change notification settings

chalk/has-ansi

Repository files navigation

has-ansi

Check if a string has ANSI escape codes

Install

npm install has-ansi

Usage

import hasAnsi from 'has-ansi';

hasAnsi('\u001B[4mUnicorn\u001B[0m');
//=> true

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

Related