UNPKG

887 BJavaScriptView Raw
1const chalk = require('chalk');
2const format = require('util').format;
3const eeuiLabel = chalk.inverse("EEUI");
4
5module.exports = {
6 info(msg) {
7 console.log(`[${chalk.green(eeuiLabel)}] ${msg}`);
8 },
9
10 success(msg) {
11 console.log(chalk.green(`[${eeuiLabel}] ${msg}`));
12 },
13
14 warn(msg) {
15 console.log(chalk.yellow(`[${eeuiLabel}] ${msg}`));
16 },
17
18 error(...args) {
19 if (args[0] instanceof Error) args[0] = args[0].message.trim();
20 const msg = format.apply(format, args);
21 console.log(chalk.red(`[${eeuiLabel}] ${msg}`));
22 },
23
24 fatal(...args) {
25 if (args[0] instanceof Error) args[0] = args[0].message.trim();
26 const msg = format.apply(format, args);
27 console.log(chalk.red(`[${eeuiLabel}] ${msg}`));
28 console.log();
29 process.exit()
30 },
31
32 sep() {
33 console.log();
34 }
35};