mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-12-22 18:21:35 +03:00
e58110afd6
* chore(checkin): cargo.lock * feat(upgrades): update and try to fix node tests * fix(@iarna): replace with @tauri-apps * chore(deps): upgrade sharp * feat(env): add env var that works on mac * feat(deps): upgrade, cleanup and update code * fix(workflow): env vars * chore(deps): upgrades * fix(.gitignore)
20 lines
389 B
JavaScript
20 lines
389 B
JavaScript
const ms = require('ms')
|
|
const chalk = require('chalk')
|
|
|
|
let prevTime
|
|
|
|
module.exports = function (banner, color = 'green') {
|
|
return function (msg) {
|
|
const curr = +new Date()
|
|
const diff = curr - (prevTime || curr)
|
|
|
|
prevTime = curr
|
|
|
|
if (msg) {
|
|
console.log(` ${chalk[color](banner)} ${msg} ${chalk.green(`+${ms(diff)}`)}`)
|
|
} else {
|
|
console.log()
|
|
}
|
|
}
|
|
}
|