Wondering what’s next for npm?Check out our public roadmap! »

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

    5.0.0 • 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,159,526

    Version

    5.0.0

    License

    MIT

    Unpacked Size

    3.3 kB

    Total Files

    4

    Last publish

    Collaborators

    • avatar
    • avatar