From 50264b92380098f66f1752f8afdcac674259b9de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Ma=C5=82ecki?= Date: Sat, 24 Sep 2011 12:31:38 +0200 Subject: [PATCH] [minor] Add none mode, which doesn't change string See nodejitsu/jitsu#101 - we need an easy way to strip all colors from output. --- colors.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/colors.js b/colors.js index 6ce4a11..8c1d706 100644 --- a/colors.js +++ b/colors.js @@ -107,8 +107,10 @@ function stylize(str, style) { 'red' : ['', ''], 'yellow' : ['', ''] }; + } 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];