Color-logs

ivanatias/color-logsgo to color logs project github repository opens a new window

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

0 dependencies

less than 1kB gzipped

Steps to use

  • Install

    npm install @ivnatsr/color-logs
  • Basic usage

    import { cl } from '@ivnatsr/color-logs'
    
    console.log(cl.blue('Hello, world!'))
  • Passing styles object

    import { cl } from '@ivnatsr/color-logs'
    
    console.log(cl.blue('Hello, world!', { font: 'bold', decoration: 'underline' }))
        
    // Or passing an array of font styles:
    console.log(cl.blue('Hello, world!', {
      font: ['bold', 'italic'],
      decoration: 'underline'
    }))

Currently supported styles

Colors

  • Blue
  • Yellow
  • Red
  • Cyan
  • Green
  • Magenta
  • White
  • Gray
  • Bright red
  • Bright green
  • Bright yellow
  • Bright blue
  • Bright magenta
  • Bright cyan
  • Bright white

Fonts

  • BoldSome sample text
  • ItalicSome sample text

Decorations

  • UnderlineSome sample text
  • StrikethroughSome sample text