
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
ansi-colors-lazy
Advanced tools
Lazyily loaded collection of ansi colors and styles.
Install with npm:
$ npm install --save ansi-colors-lazy
This module was created to make it easy to allow color configuration through options. If your application will always use specific colors, we recommend requiring those modules directly. If your application requires using most of the colors, we recommend using ansi-colors for faster require times (the colors are inlined). When using only a few colors at a time or allowing users to choose from a few colors, this module will be more efficient due to lazy caching the underlying modules.
var colors = require('ansi-colors-lazy');
Wrap a string with ansi codes to create a black background.
Params
str {String}: String to wrap with ansi codes.returns {String}: Wrapped stringExample
console.log(colors.bgblack('some string'));
Wrap a string with ansi codes to create a blue background.
Params
str {String}: String to wrap with ansi codes.returns {String}: Wrapped stringExample
console.log(colors.bgblue('some string'));
Wrap a string with ansi codes to create a cyan background.
Params
str {String}: String to wrap with ansi codes.returns {String}: Wrapped stringExample
console.log(colors.bgcyan('some string'));
Wrap a string with ansi codes to create a green background.
Params
str {String}: String to wrap with ansi codes.returns {String}: Wrapped stringExample
console.log(colors.bggreen('some string'));
Wrap a string with ansi codes to create a magenta background.
Params
str {String}: String to wrap with ansi codes.returns {String}: Wrapped stringExample
console.log(colors.bgmagenta('some string'));
Wrap a string with ansi codes to create a red background.
Params
str {String}: String to wrap with ansi codes.returns {String}: Wrapped stringExample
console.log(colors.bgred('some string'));
Wrap a string with ansi codes to create a white background.
Params
str {String}: String to wrap with ansi codes.returns {String}: Wrapped stringExample
console.log(colors.bgwhite('some string'));
Wrap a string with ansi codes to create a yellow background.
Params
str {String}: String to wrap with ansi codes.returns {String}: Wrapped stringExample
console.log(colors.bgyellow('some string'));
Wrap a string with ansi codes to create black text.
Params
str {String}: String to wrap with ansi codes.returns {String}: Wrapped stringExample
console.log(colors.black('some string'));
Wrap a string with ansi codes to create blue text.
Params
str {String}: String to wrap with ansi codes.returns {String}: Wrapped stringExample
console.log(colors.blue('some string'));
Wrap a string with ansi codes to create bold text.
Params
str {String}: String to wrap with ansi codes.returns {String}: Wrapped stringExample
console.log(colors.bold('some string'));
Wrap a string with ansi codes to create cyan text.
Params
str {String}: String to wrap with ansi codes.returns {String}: Wrapped stringExample
console.log(colors.cyan('some string'));
Wrap a string with ansi codes to create dim text.
Params
str {String}: String to wrap with ansi codes.returns {String}: Wrapped stringExample
console.log(colors.dim('some string'));
Wrap a string with ansi codes to create gray text.
Params
str {String}: String to wrap with ansi codes.returns {String}: Wrapped stringExample
console.log(colors.gray('some string'));
Wrap a string with ansi codes to create green text.
Params
str {String}: String to wrap with ansi codes.returns {String}: Wrapped stringExample
console.log(colors.green('some string'));
Wrap a string with ansi codes to create grey text.
Params
str {String}: String to wrap with ansi codes.returns {String}: Wrapped stringExample
console.log(colors.grey('some string'));
Wrap a string with ansi codes to create hidden text.
Params
str {String}: String to wrap with ansi codes.returns {String}: Wrapped stringExample
console.log(colors.hidden('some string'));
Wrap a string with ansi codes to create inverse text.
Params
str {String}: String to wrap with ansi codes.returns {String}: Wrapped stringExample
console.log(colors.inverse('some string'));
Wrap a string with ansi codes to create italic text.
Params
str {String}: String to wrap with ansi codes.returns {String}: Wrapped stringExample
console.log(colors.italic('some string'));
Wrap a string with ansi codes to create magenta text.
Params
str {String}: String to wrap with ansi codes.returns {String}: Wrapped stringExample
console.log(colors.magenta('some string'));
Wrap a string with ansi codes to create red text.
Params
str {String}: String to wrap with ansi codes.returns {String}: Wrapped stringExample
console.log(colors.red('some string'));
Wrap a string with ansi codes to reset ansi colors currently on the string.
Params
str {String}: String to wrap with ansi codes.returns {String}: Wrapped stringExample
console.log(colors.reset('some string'));
Wrap a string with ansi codes to add a strikethrough to the text.
Params
str {String}: String to wrap with ansi codes.returns {String}: Wrapped stringExample
console.log(colors.strikethrough('some string'));
Wrap a string with ansi codes to underline the text.
Params
str {String}: String to wrap with ansi codes.returns {String}: Wrapped stringExample
console.log(colors.underline('some string'));
Wrap a string with ansi codes to create white text.
Params
str {String}: String to wrap with ansi codes.returns {String}: Wrapped stringExample
console.log(colors.white('some string'));
Wrap a string with ansi codes to create yellow text.
Params
str {String}: String to wrap with ansi codes.returns {String}: Wrapped stringExample
console.log(colors.yellow('some string'));
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)
To generate the readme, run the following command:
$ npm install -g verbose/verb#dev verb-generate-readme && verb
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
$ npm install && npm test
Brian Woodward
Copyright © 2017, Brian Woodward. Released under the MIT License.
This file was generated by verb-generate-readme, v0.6.0, on December 06, 2017.
FAQs
Lazyily loaded collection of ansi colors and styles.
The npm package ansi-colors-lazy receives a total of 4 weekly downloads. As such, ansi-colors-lazy popularity was classified as not popular.
We found that ansi-colors-lazy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.