has-ansi
TypeScript icon, indicating that this package has built-in type declarations

6.0.0 • Public • Published

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

Package Sidebar

Install

npm i has-ansi

Weekly Downloads

7,347,994

Version

6.0.0

License

MIT

Unpacked Size

3.15 kB

Total Files

5

Last publish

Collaborators

  • sindresorhus
  • qix