planify
Version:
Plan a series of steps and display the output in a beautiful way
21 lines (14 loc) • 375 B
JavaScript
;
const util = require('util');
const chalk = require('chalk');
const colors = {
slow: 'red',
medium: 'yellow',
fast: 'grey',
};
function duration(step, template) {
const color = colors[step.info.speed];
template = template || '%s';
return chalk[color](util.format(template, step.info.duration + 'ms'));
}
module.exports = duration;