npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

has-ansi

6.0.0

@sindresorhus

npmHomeRepoSnykSocket
Downloads:57602468
$ npm install has-ansi
DailyWeeklyMonthlyYearly

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

  • has-ansi-cli - CLI for this module
  • strip-ansi - Strip ANSI escape codes
  • ansi-regex - Regular expression for matching ANSI escape codes
  • chalk - Terminal string styling done right