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

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Jul 10, 2024
3277295 · Jul 10, 2024

History

41 Commits
Jul 10, 2024
Jun 20, 2017
Sep 10, 2019
Sep 10, 2019
Sep 10, 2019
Jul 10, 2024
Apr 16, 2021
Jul 10, 2024
Apr 16, 2021
Jul 10, 2024
Jul 10, 2024
Apr 16, 2021

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