colors.js
colors.js copied to clipboard
Template Strings
console.log(`one ${'two'.red} three`.blue)
results in

\u001b[34mone \u001b[31mtwo\u001b[39m three\u001b[39m
ideally one would be blue as well
created template-colors to solve this problem
Related: https://github.com/xpl/ansicolor
I guess it's due to ANSI codes being processed in linear vs. some hierarchical order. We could consider doing something to make this kind of thing work in colors as well.