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.

    Install

    npm i has-ansi

    DownloadsWeekly Downloads

    14,971,979

    Version

    5.0.1

    License

    MIT

    Unpacked Size

    3.3 kB

    Total Files

    4

    Last publish

    Collaborators

    • sindresorhus
    • qix