has-ansi
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/has-ansi package

5.0.1 • 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

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.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 5.0.1
    6,200
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 5.0.1
    6,200
  • 5.0.0
    84
  • 4.0.1
    999,856
  • 4.0.0
    1,243
  • 3.0.0
    485,536
  • 2.0.0
    26,568,156
  • 1.0.3
    112,335
  • 1.0.2
    10
  • 1.0.1
    14
  • 1.0.0
    11
  • 0.1.0
    1,146,365

Package Sidebar

Install

npm i has-ansi

Weekly Downloads

12,545,631

Version

5.0.1

License

MIT

Unpacked Size

3.3 kB

Total Files

4

Last publish

Collaborators

  • sindresorhus
  • qix