░▒▓████████████████████████████████▓▒░ ░▒▓█ ▓▒░ ░▒▓█ ~ S W A M P ~ ▓▒░ ░▒▓█ ▓▒░ ░▒▓████████████████████████████████▓▒░
pplmvsvm
LOCATION:
/usr/lib/node_modules/npm/node_modules/are-we-there-yet/lib
☗ ROOT
↻ REFRESH
✎ CARVE FLESH
EDITING: tracker.js
'use strict' var util = require('util') var TrackerBase = require('./tracker-base.js') var Tracker = module.exports = function (name, todo) { TrackerBase.call(this, name) this.workDone = 0 this.workTodo = todo || 0 } util.inherits(Tracker, TrackerBase) Tracker.prototype.completed = function () { return this.workTodo === 0 ? 0 : this.workDone / this.workTodo } Tracker.prototype.addWork = function (work) { this.workTodo += work this.emit('change', this.name, this.completed(), this) } Tracker.prototype.completeWork = function (work) { this.workDone += work if (this.workDone > this.workTodo) { this.workDone = this.workTodo } this.emit('change', this.name, this.completed(), this) } Tracker.prototype.finish = function () { this.workTodo = this.workDone = 1 this.emit('change', this.name, 1, this) }
CANCEL
Name
Type
Size
Modified
Actions
↩ ..
DIR
—
—
📄 index.js
JS
163 B
2023-09-24 03:45
EDIT
📄 tracker-base.js
JS
274 B
2023-09-24 03:45
EDIT
📄 tracker-group.js
JS
3.2 KB
2023-09-24 03:45
EDIT
📄 tracker-stream.js
JS
963 B
2023-09-24 03:45
EDIT
📄 tracker.js
JS
836 B
2023-09-24 03:45
EDIT