Created
February 27, 2020 03:45
-
-
Save KrishnaPravin/cc7932857ab5f2b93d492a3071829122 to your computer and use it in GitHub Desktop.
Get colour escape sequence for javascript console.log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = new Proxy( | |
{ fgRed: "31", fgGreen: "32" }, // More colors @ https://stackoverflow.com/a/41407246/5947136 | |
{ get: (obj, prop) => `\x1b[${obj[prop]}m%s\x1b[0m` } | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment