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
    4,818
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 5.0.1
    4,818
  • 5.0.0
    165
  • 4.0.1
    830,600
  • 4.0.0
    1,484
  • 3.0.0
    318,348
  • 2.0.0
    26,334,161
  • 1.0.3
    111,743
  • 1.0.2
    20
  • 1.0.1
    19
  • 1.0.0
    23
  • 0.1.0
    1,175,583

Package Sidebar

Install

npm i has-ansi

Weekly Downloads

10,983,212

Version

5.0.1

License

MIT

Unpacked Size

3.3 kB

Total Files

4

Last publish

Collaborators

  • sindresorhus
  • qix