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 26, 2024 via pnpm
Package summary
Share
0
issues
1
license
3
MIT
Package created
31 Jul 2013
Version published
4 Oct 2020
Maintainers
2
Total deps
3
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
3 Packages, Including:
ansi-styles@4.3.0
color-convert@2.0.1
color-name@1.1.4
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 ansi-styles 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
color-convert2.0.18.79 kBMIT
prod

Visualizations

Frequently Asked Questions

What does ansi-styles do?

The npm package ansi-styles gives you access to ANSI escape codes which can be used for styling strings that will be output to the terminal. It allows transforming a simple string into a colored, or otherwise stylized, piece of text that is viewable in your terminal display.

How do you use ansi-styles?

To start using ansi-styles, you first need to install the package using npm with the command: npm install ansi-styles. Once installed, you can start styling your terminal strings. Here are a few examples of how you could use ansi-styles:

import styles from 'ansi-styles';

// This will output the text 'Hello world!' in green color
console.log(`${styles.green.open}Hello world!${styles.green.close}`);

// The following statements will output 'Hello World' in true-color, based on RGB values provided
console.log(`${styles.color.ansi(styles.rgbToAnsi(199, 20, 250))}Hello World${styles.color.close}`);
console.log(`${styles.color.ansi256(styles.rgbToAnsi256(199, 20, 250))}Hello World${styles.color.close}`);
console.log(`${styles.color.ansi16m(...styles.hexToRgb('#abcdef'))}Hello World${styles.color.close}`);

// This will text whether certain styles are included in the available modifiers and colors
console.log(styles.modifierNames.includes('bold'));  // true
console.log(styles.foregroundColorNames.includes('pink'));  // false

Where are the ansi-styles docs?

The official documentation for ansi-styles is contained within its README file on GitHub. Here, you can find detailed usage examples, the API description, a list of all available styles which range from color modifiers to background colors, and advanced usage tips about the available color spaces and the conversion functions for turning various color formats into ANSI escapes.