subprogress
v1.0.0
Published
Progress aggregator for weighted sub-tasks.
Downloads
5
Readme
subprogress
Progress aggregator for weighted sub-tasks.
Installation
This module is installed via npm:
$ npm install subprogress
Example Usage
var progress = require('subprogress')();
progress.registerTask('render', 'Render the things', 1);
progress.registerTask('tidy', 'Tidy up', 2);
progress.emitter.once('progress', function(result) {
expect(result).to.eql({ task: 'one', details: 'desc', percent: 10 });
if (count == 2) done();
});
progress.emitter.once('totalProgress', function(result) {
expect(result).to.be(10/3);
});
progress.updateTask('one', 10);