has-ansi

v0.1.0
Check if a string has ANSI escape codes
cli bin ansi styles color colour colors terminal console and 16 more...

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

Metadata

  • MIT
  • >=0.10.0
  • Sindre Sorhus
  • released 6/14/2014

Downloads

Maintainers