-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefaults
executable file
·25 lines (24 loc) · 1.01 KB
/
defaults
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env node
var ttycolor = require('..')(),
defaults = ttycolor.defaults, revert, styles, keys;
revert = defaults(null, true);
keys = Object.keys(ttycolor.styles); ansi = ttycolor.ansi;
keys.forEach(function(method) {console[method]('%s: %s', method, 'message')})
revert();
keys.forEach(function(method) {console[method]('%s: %s', method, 'message')})
styles = {
log: {format: ['normal'], parameters: ['normal', 'underline']},
info: {format: ['cyan'], parameters: ['cyan', 'underline']},
warn: {format: ['magenta'], parameters: ['magenta', 'underline']},
error: {format: ['red'], parameters: ['red', 'underline']}
}
defaults(styles, true);
keys.forEach(function(method) {console[method](method + ': %s', 'message')})
keys.forEach(function(method) {
console[method]('[%s] %s', ansi(method).bright[styles[method].format],
ansi(method).underline.bright[styles[method].format]);
});
keys.forEach(function(method) {
console[method]('[%s] %s', ansi(method).bright[styles[method].format],
ansi(method).bright);
});