Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/noblesamurai/subprogress
Progress aggregator for weighted sub-tasks.
https://github.com/noblesamurai/subprogress
Last synced: about 1 month ago
JSON representation
Progress aggregator for weighted sub-tasks.
- Host: GitHub
- URL: https://github.com/noblesamurai/subprogress
- Owner: noblesamurai
- License: other
- Created: 2016-06-30T02:15:39.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-07-13T03:02:55.000Z (over 3 years ago)
- Last Synced: 2024-12-01T08:39:53.960Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# subprogress
Progress aggregator for weighted sub-tasks.
[![build status](https://secure.travis-ci.org/timothyleslieallen/subprogress.png)](http://travis-ci.org/timothyleslieallen/subprogress)
## Prerequisites
```
$ pip install pre-commit
```## Installation
This module is installed via npm:
``` bash
$ pre-commit install --install-hooks
$ npm install subprogress
```## Example Usage
```js
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);
```