goalist
Version:
Goalist is a command line tool for managing daily goals.
32 lines (31 loc) • 1.09 kB
JavaScript
;
exports.__esModule = true;
var barHorizontal = require("bar-horizontal");
function progress(INPUT, ARGS, config) {
return new Promise(function (resolve, reject) {
var log = config.utils.getLog('active');
var goals = log.goals;
var total = Object.keys(goals).length;
var complete = config.utils.getComplete(goals).length;
var incomplete = total - complete;
config["debugger"].log('OVERVIEW');
config["debugger"].log("Total: " + total + "\r");
config["debugger"].log("Complete: " + complete + "\r");
config["debugger"].log("Incomplete: " + incomplete + "\n");
if (config.cli && config["debugger"].getMode() !== 'silent') {
barHorizontal({
'Complete': complete,
'Incomplete': incomplete
}, {
labels: true
});
}
resolve({
type: 'active',
total: total,
complete: complete,
incomplete: incomplete
});
});
}
exports["default"] = progress;