13 lines
398 B
JavaScript
13 lines
398 B
JavaScript
|
const chalk = require('chalk');
|
||
|
const config = require('./config');
|
||
|
const colors = {log: 'blue', success: 'green', error: 'red', warn: 'yellow'};
|
||
|
|
||
|
// rewrite to use Object.keys()
|
||
|
for (let property in colors) {
|
||
|
if (colors.hasOwnProperty(property)) {
|
||
|
module.exports[property] = (type, msg) => {
|
||
|
console.log(chalk.keyword(colors[property])(`[ ${type.toUpperCase()} ] ${msg}`));
|
||
|
};
|
||
|
}
|
||
|
}
|