chalk / has-ansi

Check if a string has ANSI escape codes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

Maintainers


Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

About

Check if a string has ANSI escape codes

License:MIT License


Languages

Language:JavaScript 100.0%