mirror of
https://github.com/frappe/books.git
synced 2024-11-14 01:14:03 +00:00
ddd9a786d2
- frappe start command - starts frappejs server - sets up webpack middleware to bundle files - introduce frappe.conf.js for configuration
20 lines
438 B
JavaScript
20 lines
438 B
JavaScript
const ms = require('ms');
|
|
const chalk = require('chalk');
|
|
|
|
let prevTime;
|
|
|
|
module.exports = function (banner, color = 'green') {
|
|
return function (message) {
|
|
const currentTime = +new Date();
|
|
const diff = currentTime - (prevTime || currentTime);
|
|
prevTime = currentTime;
|
|
|
|
if (message) {
|
|
console.log(` ${chalk[color](banner)} ${message} ${chalk.green(`+${ms(diff)}`)}`)
|
|
}
|
|
else {
|
|
console.log()
|
|
}
|
|
}
|
|
}
|