Created
October 29, 2017 22:38
-
-
Save Sinequanonh/611b9d157eed3c6f07e934039448ab64 to your computer and use it in GitHub Desktop.
Colorizes javascript strings
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
const red = '\033[31m' | |
const green = '\033[32m' | |
const magenta = '\033[35m' | |
const cyan = '\033[36m' | |
const blue = '\033[34m' | |
const yellow = '\033[33m' | |
const white = '\033[0m' | |
module.exports = { | |
red(string) { | |
return red + string + white | |
}, | |
green(string) { | |
return green + string + white | |
}, | |
cyan(string) { | |
return cyan + string + white | |
}, | |
yellow(string) { | |
return yellow + string + white | |
}, | |
blue(string) { | |
return blue + string + white | |
}, | |
magenta(string) { | |
return magenta + string + white | |
}, | |
white(string) { | |
return white + string + white | |
} | |
} | |
// const colorize = require(./colorize.js) | |
// console.log(colorize.green('Hello world')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment