label-log
v0.1.1
Published
beautiful label in console log
Downloads
2
Readme
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 isgreen
.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 isyellow
.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:
License
MIT @chilijung
Reference
- http://ascii-table.com/ansi-escape-sequences.php