Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Add multi-mode styling #4

Marak opened this Issue Apr 15, 2011 · 5 comments


None yet
4 participants

Marak commented Apr 15, 2011

We should be able to switch colors into one of three modes:

The first mode will operate as colors.js works now. It will apply ANSI escape codes to the string.

The second will return an object literal describing the object which was sent to it, i.e. 'foo'.yellow returns { string: 'foo', styling: ['yellow'] }

The third mode ( as suggested by @TooTallNate ) will output colored html markup for the browser.

I think a mode that outputs HTML <span style="color:yellow;"> tags would be a cool idea too, that way you could use it in the browser too!


Marak commented Apr 15, 2011

Agreed, I bet @ded would like that too!


ded commented Apr 15, 2011



Marak commented Apr 15, 2011

Okay, I think I can bang this out relatively soon. This is part of a chain of tickets:


Gotta love having a stack built from all your own shite!

@Marak Marak closed this Oct 1, 2014

I do get these ansi escapers in my log files on exceptions. is there an option to strip them, it makes the log very unreadable:


winston.handleExceptions(new winston.transports.File({ filename: 'logs/uncaughtExceptions.log' }))


\u001b[0m\u001b[97m\u001b[41mError\u001b[0m\u001b[90m:\u001b[0m\u001b[37m \u001b[0m\u001b[97mlisten EACCES\u001b[0m","\u001b[0m  \u001b[0m","\u001b[0m  \u001b[0m\u001b[90m-\u001b[0m \u001b[0m\u001b[93mutil.js\u001b[0m\u001b[90m:\u001b[0m\u001b[93m856\u001b[0m\u001b[37m \u001b[0m\u001b[37mObject.exports._errnoException\u001b[0m","\u001b[0m  \u001b[0m  \u001b[0m\u001b[90mutil.js:856:11\u001b[0m","\u001b[0m  \u001b[0m","\u001b[0m  \u001b[0m\u001b[90m-\u001b[0m \u001b[0m\u001b[93mutil.js\u001b[0m\u001b[90m:\u001b[0m\u001b[
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment