Skip to content

Instantly share code, notes, and snippets.

@GUIEEN
Created January 3, 2019 16:12
Show Gist options
  • Save GUIEEN/8db1757f6ef11fd706c42a4496a47a81 to your computer and use it in GitHub Desktop.
Save GUIEEN/8db1757f6ef11fd706c42a4496a47a81 to your computer and use it in GitHub Desktop.
Stdout message with color.
import colors from 'colors'
const log = (...args: Object[]) => {
args.forEach(e => {
if (typeof e === 'object') {
console.dir(e, { depth: null })
} else if (typeof e === 'boolean') {
console.log(colors.bgMagenta.white(` ${e} `))
} else {
console.log(colors.bgCyan.black(` ${e} `))
}
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment