UNPKG

450 BJavaScriptView Raw
1const chalk = require('chalk')
2const chalkLog = function(type, text, isExit) {
3 console.log(chalk[type](text))
4 isExit && process.exit()
5}
6exports.error = function(t, isExit = true) {
7 chalkLog('red', t, isExit)
8}
9exports.success = function(t, isExit) {
10 chalkLog('green', t, isExit)
11}
12exports.warning = function(t, isExit) {
13 chalkLog('yellow', t, isExit)
14}
15exports.info = function(t, isExit) {
16 chalkLog('gray', t, isExit)
17}