label-log

0.1.1 • Public • Published

Label log

label in console.log.

Install

npm install label-log

API

label.front()

label.front([label array], [background color array], [font color array], [console message])

label from the front!

label.back()

label.back([label array], [background color array], [font color array], [console message])

label from the back!

Parameters:

  • label array: must [type: array]: some labels you want to label to this console log.

  • background color array: optional [type: array]: background color for each label, if the length is not enough for the array. The last color will place for the rest. The default value is green.

  • color array: optional [type: array]: font color for each label, if the length is not enough for the array. The last color will place for the rest. The default value is yellow.

  • message: must [type: string]: console message you want to appear

background color support:

  • grey
  • black
  • yellow
  • red
  • green
  • blue
  • white
  • cyan
  • magenta

font support:

  • bold
  • underline
  • strikethrough
  • italic
  • inverse
  • grey
  • black
  • yellow
  • red
  • green
  • blue
  • white
  • cyan
  • magenta

Example:

var label = require('label-log');
 
// front
 
label.front(['test', 'test2', 'test3'],['green', 'blue', 'green'], ['blue', 'green', 'yellow'], 'this is a test');
label.front(['test', 'test5', 'test4'],['green', 'blue'], ['blue', 'red', 'yellow'], 'this is a test');
label.front(['test', 'test5', 'test4'],['green'], ['blue', 'red', 'yellow'], 'this is a test');
label.front(['test', 'test5', 'test4'],['green', 'blue'], 'this is a test');
label.front(['test', 'test5', 'test4'], 'this is a test');
 
 
// Back
 
label.back(['test', 'test5', 'test4'],['green', 'blue', 'green'], ['blue', 'green', 'yellow'], 'this is a test');
label.back(['test', 'test5', 'test4'],['green', 'blue', 'green'], ['blue', 'red'], 'this is a test');
label.back(['test', 'test5', 'test4'],['green'], ['blue', 'red', 'yellow'], 'this is a test');
label.back(['test', 'test5', 'test4'],['green', 'blue', 'green'], 'this is a test');
label.back(['test', 'test5', 'test4'],['white'], ['red'], 'this is a test');
 
 

Preview:

pre

License

MIT @chilijung

Reference

Readme

Keywords

none

Package Sidebar

Install

npm i label-log

Weekly Downloads

2

Version

0.1.1

License

MIT

Last publish

Collaborators

  • chilijung