Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including has-ansi with all npm packages installed. Try it out:

var hasAnsi = require("has-ansi")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

has-ansi v3.0.0

Check if a string has ANSI escape codes

has-ansi Build Status

Check if a string has ANSI escape codes

Install

$ npm install has-ansi

Usage

const hasAnsi = require('has-ansi');

hasAnsi('\u001B[4mUnicorn\u001B[0m');
//=> true

hasAnsi('cake');
//=> false

Related

Maintainers

License

MIT

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free