New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

addcolor

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

addcolor

Add color to Node.js console text and background.

latest
Source
npmnpm
Version
1.0.6
Version published
Maintainers
1
Created
Source

addcolor

Add color to Node.js console text and background.

Installation

npm i addcolor

Usage

import color from 'addcolor';

console.log(color.yellow('add color to text'));

console.log(`${color.bg.blue('add color to background')} also ${color.style.reverse('reverse background & foreground')}`);

Use color codes

console.log(`${color.code.fg.black}black text and ${color.code.bg.cyan}black text with cyan background${color.code.reset}`);

Use both color & style at the same time

console.log(color.red('red and bold ', 'bright'));
console.log(color.style.bold('bold and red', 'red'));

Quick run through all the colors & styles

for (let type in code)
    if (type !== 'reset')
        for (let item in code[type])
            console.log(code[type][item], item, code.reset)

Colors

Both foreground and background

  • black
  • red
  • green
  • yellow
  • blue
  • magenta
  • cyan
  • white
  • default
  • blackBright
  • redBright
  • greenBright
  • yellowBright
  • blueBright
  • magentaBright
  • cyanBright
  • whiteBright

Styles

  • bold
  • dim
  • italic
  • underscore
  • blink
  • rapidBlink
  • reverse
  • hidden
  • strikethrough

Keywords

cli

FAQs

Package last updated on 23 Jan 2020

Did you know?

Socket

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