Socket
Book a DemoInstallSign in
Socket

colorize-log

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

colorize-log

Gives Color to your console logs

latest
Source
npmnpm
Version
0.0.3
Version published
Maintainers
1
Created
Source

Colorize Log

Installation

--save will save colorize-log to your package dependencies

npm install colorize-log --save

Options

  • levels - Array of your custom levels
  • colors - Object of your custom levels with their respective colors
  • consoleColor - Color of your console
  • showLevels - Boolean - Show custom Level before message
  • levelsCase - Default is lowercase you can use uppercase and camelcase.
  • colorizeLevels - Boolean - if false, level will adopt the consoleCoolor option

Allowed Colors

  • Best for "levels colors" - black,red,green,yellow,blue,magenta,cyan,white & gray
  • Best for "consoleColor" - reset, bright,dim,underline,blink,reverse & hidden
  • Terminal Background colors for "consoleColor" - bgBlack,bgRed,bgGreen,bgYellow,bgBlue,bgMagenta,bgCyan,bgwhite

USAGE

create your own custom console levels and colors

  var options = {
    levels: ['custom1', 'custom2', 'custom3', 'success'],
    colors: {
      custom1:'gray', 
      custom2:'yellow', 
      custom3:'red',
      success:'green'
      },
    consoleColor: 'cyan', // best to use 'reset' 
    showLevels:true,
    levelsCase:'uppercase', //lowercase,camelcase
    colorizeLevels: true
  }
  var Logger = require('colorize-log')
  var Log = new Logger(options)
    Log.custom1('Message 1')
    Log.custom2('Message 2')
    Log.custom3('Message 3')
    Log.success('Success Message')

Keywords

log color

FAQs

Package last updated on 17 Apr 2017

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