Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Feb 12, 2024 via pnpm
Package summary
Share
0
issues
1
license
2
MIT
Package created
14 Jun 2014
Version published
30 Jun 2015
Maintainers
2
Total deps
2
Direct deps
1
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
2 Packages, Including:
ansi-regex@2.1.1
has-ansi@2.0.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

1
All Dependencies CSV
β“˜ This is a list of has-ansi 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
ansi-regex2.1.12.29 kBMIT
prod

Visualizations

Frequently Asked Questions

What does has-ansi do?

The npm package "has-ansi" is utilized to check if a particular string contains ANSI escape codes. ANSI escape codes are sequences of characters used to control cursor location, color, and other options on video text terminals. This makes "has-ansi" an invaluable tool in situations where identification of such codes within strings is required. To be able to analyze whether a string contains these codes or not can prove immensely helpful, particularly when working on text processing or terminal applications.

How do you use has-ansi?

"has-ansi" can be implemented in a JavaScript project with agile ease. First, it needs to be installed using Node Package Manager (npm), with the command npm install has-ansi. Post-installation, it can be imported into your JavaScript file as such: import hasAnsi from 'has-ansi';.

Here's an example of how to use "has-ansi" in your code:

import hasAnsi from 'has-ansi';

hasAnsi('\u001B[4mUnicorn\u001B[0m');
//=> This will return true as the string contains ANSI escape codes

hasAnsi('cake');
//=> This will return false as the string does not contain any ANSI escape codes

As seen in the above example, the "hasAnsi" function simply checks the provided string for ANSI escape codes and returns a boolean value. Dependable and unambiguous, "has-ansi" shines particularly in high-readability scenarios where swift detection of ANSI codes becomes a matter of efficiency.

Where are the has-ansi docs?

The documentation for "has-ansi" is accessible right in its README file available at the GitHub repository (https://github.com/chalk/has-ansi). This documentation provides details regarding the installation and usage of the package. It also includes details about related packages and links to the profiles of the maintainers. Rich with targeted details and well-maintained by the authors, the "has-ansi" GitHub repo serves as an all-in-one information hub for end-users.