Socket
Socket
Sign inDemoInstall

colors

Package Overview
Dependencies
0
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    colors

get colors in your node.js console like what


Version published
Weekly downloads
13M
decreased by-20.38%
Maintainers
1
Created
Weekly downloads
 

Package description

What is colors?

The 'colors' npm package is used to add color and style to text in the Node.js console. It allows developers to easily format their console output by adding colors, background colors, and styles such as bold or underline to their text.

What are colors's main functionalities?

Text colors

This feature allows you to change the color of the text. You can use predefined color names to set the text color.

console.log('hello'.green); // Outputs green text

Background colors

Similar to text colors, this feature allows you to set the background color of the text using predefined color names.

console.log('hello'.bgGreen); // Outputs text with a green background

Text styles

This feature allows you to apply different styles to your text, such as making it bold, underlined, or dim.

console.log('hello'.bold); // Outputs bold text

Chaining multiple styles

You can chain multiple styles together to apply several formats to your text at once.

console.log('hello'.green.underline.bold); // Outputs green, underlined, bold text

Custom themes

You can define custom themes to create a combination of styles that can be reused throughout your application.

colors.setTheme({ custom: ['red', 'underline'] }); console.log('hello'.custom); // Outputs red underlined text

Other packages similar to colors

Readme

Source

colors.js - get color and style in your node.js console like what

   var sys = require('sys');
   var colors = require('./colors');

   sys.puts('hello'.green); // outputs green text
   sys.puts('i like cake and pies'.underline.red) // outputs red underlined text
   sys.puts('inverse the color'.inverse); // inverses the color
   sys.puts('OMG Rainbows!'.rainbow); // rainbow (ignores spaces)
   

colors and styles!

- bold - italic - underline - inverse - yellow - cyan - white - magenta - green - red - grey - blue

Authors

Alexis Sellier (cloudhead) , Marak Squires , Justin Campbell, Dustin Diaz (@ded)

FAQs

Last updated on 25 Sep 2011

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc