Skip to content

ivanatias/color-logs

Repository files navigation

Color-logs

Prettify Node.js console logs with some nice colors, easily.

Install

npm install @ivnatsr/color-logs

Basic usage

import { cl } from '@ivnatsr/color-logs'

console.log(cl.blue('Hello, world!'))

You can also pass a styles object to set font style and decorations:

console.log(cl.blue('Hello, world!', { font: 'bold', decoration: 'underline' }))

Combining font styles:

console.log(
  cl.blue('Hello, world!', {
    font: ['bold', 'italic'],
    decoration: 'underline'
  })
)

Supported styles:

Colors

  • blue
  • yellow
  • red
  • cyan
  • green
  • magenta
  • white
  • gray
  • brightRed
  • brightGreen
  • brightYellow
  • brightBlue
  • brightMagenta
  • brightCyan
  • brightWhite

Font

  • bold
  • italic

Decoration

  • underline
  • strikethrough