Chalk
There are many wonderful node modules that adhere to Unix philosophy:
"Write programs that do one thing and do it well."
Out of many such one such elegant module is chalk thanks to Sindre Sorhus for that.
Whenever one wants to color the terminal, as in styling the strings on the console the first module that would come to mind is colors.js but one of the major drawbacks with that being it extending String.portotye
or be these problems.
Installing chalk is like any other module: npm install --save chalk
Apart from allow the normal styling syntax, it also provides multiple styles, nested styles and multiple arguments.
For example:
1 2 3 4 5 |
|
Here is a simple snippet for printing all of the styles it provides:
1 2 3 4 5 6 7 |
|
gif FTW!?
Until next week, happy coloring!