# progress-pipeline **Repository Path**: mirrors_regular/progress-pipeline ## Basic Information - **Project Name**: progress-pipeline - **Description**: like async.series but with a readable-stream interface for progress events - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-09-25 - **Last Updated**: 2026-05-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README progress-pipeline === Like async.series, but with a readable-stream interface for getting progress events. Installation --- ``` npm install progress-pipeline ``` Usage --- ``` javascript var series = require('progress-pipeline'); var jobs =[ function cloning(cb) { gitClone(user + '/' + repo, function(err) { cb(err, 'done cloning'); }); }, function installing(cb) { shell('cd '+ repo +' && npm install', function(err) { cb(err, 'done installing'); }); } ]; series(jobs).on('data', function(data) { console.log(data.jobFinished ? data.result : data.jobIndex + '/' + data.totalJobs + data.job.name + ' ...'); }); ``` output: ``` 0/2 cloning ... done cloning 1/2 installing ... done installing ``` Job Functions --- Jobs are regular, node-style async functions, e.g. they are being called with an [error-first callback](http://fredkschott.com/post/2014/03/understanding-error-first-callbacks-in-node-js/) and are required to call that callback with an error and an optional result argument. _Note_ You can add properties to the job functions before putting them into the pipeline and you will have access to these prperties in your on('data') event handler. See [demo.js](./demo.js) for an example. Events --- You get two `data` events per job * one when the job has started ``` { jobFinished: false, job: jobIndex: totalJobs: } ``` * and one when the job has finished ``` { jobFinished: true, job: jobIndex: totalJobs: result: } ``` In case a job fails, the stream emits an `error` event. The emitted error has the following additional properties: ``` { job: jobIndex: totalJobs: } ```