[minor] Add none mode, which doesn't change string

See nodejitsu/jitsu#101 - we need an easy way to strip all colors from
output.
This commit is contained in:
Maciej Małecki 2011-09-24 12:31:38 +02:00
parent 4a63717497
commit 50264b9238

View File

@ -107,8 +107,10 @@ function stylize(str, style) {
'red' : ['<span style="color:red;">', '</span>'],
'yellow' : ['<span style="color:yellow;">', '</span>']
};
} else if (exports.mode == 'none') {
return str;
} else {
console.log('unsupported mode, try "browser" or "console"');
console.log('unsupported mode, try "browser", "console" or "none"');
}
return styles[style][0] + str + styles[style][1];