{"_id":"progress-stream","_rev":"141137","name":"progress-stream","description":"Read the progress of a stream","dist-tags":{"latest":"2.0.0"},"maintainers":[{"name":"freeall","email":"freeall@gmail.com"}],"time":{"modified":"2021-06-03T11:26:58.000Z","created":"2013-12-11T13:10:36.544Z","2.0.0":"2017-04-11T09:06:54.927Z","1.2.0":"2015-12-01T13:59:15.553Z","1.1.2":"2015-12-01T13:50:51.184Z","1.1.1":"2015-04-14T07:46:43.156Z","1.1.0":"2015-04-01T20:09:17.682Z","1.0.1":"2015-02-25T09:50:56.858Z","1.0.0":"2015-02-25T09:44:48.285Z","0.5.0":"2014-05-14T09:26:39.941Z","0.4.0":"2014-01-09T16:32:17.616Z","0.3.0":"2013-12-13T15:11:27.550Z","0.2.1":"2013-12-11T20:20:45.202Z","0.2.0":"2013-12-11T19:42:37.226Z","0.1.1":"2013-12-11T13:12:12.001Z","0.1.0":"2013-12-11T13:10:36.544Z"},"users":{"maxogden":true,"f124275809":true,"shawnbot":true,"jamescostian":true,"koslun":true,"moimikey":true,"foto":true,"ezodude":true,"mjurincic":true,"quocnguyen":true,"wisecolt":true,"imaginary":true,"rocket0191":true,"usex":true,"karuppiah":true,"alvis":true,"ragib.hasin":true,"astesio":true,"chirag8642":true,"temasm":true,"tomgao365":true,"mordenius":true,"wangsong1224":true,"ricardweii":true,"lirunkai":true},"author":{"name":"freeall","email":"freeall@gmail.com"},"repository":{"type":"git","url":"git+ssh://git@github.com/freeall/progress-stream.git"},"versions":{"2.0.0":{"name":"progress-stream","version":"2.0.0","description":"Read the progress of a stream","repository":{"type":"git","url":"git+ssh://git@github.com/freeall/progress-stream.git"},"keywords":["stream","progress","percentage","percent","download","upload","file","streaming","request","http"],"main":"index.js","dependencies":{"speedometer":"~1.0.0","through2":"~2.0.3"},"devDependencies":{"request":"~2.29.0","single-line-log":"~1.0.0","numeral":"~1.5.2"},"scripts":{"test":"node test/http.js && node test/request.js"},"author":{"name":"freeall","email":"freeall@gmail.com"},"license":"BSD-2-Clause","gitHead":"1beb155de00a5ee77feb7f422e56e3bec0bcd167","bugs":{"url":"https://github.com/freeall/progress-stream/issues"},"homepage":"https://github.com/freeall/progress-stream#readme","_id":"progress-stream@2.0.0","_shasum":"fac63a0b3d11deacbb0969abcc93b214bce19ed5","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.4.0","_npmUser":{"name":"freeall","email":"freeall@gmail.com"},"dist":{"shasum":"fac63a0b3d11deacbb0969abcc93b214bce19ed5","size":3890,"noattachment":false,"key":"/progress-stream/-/progress-stream-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/progress-stream/download/progress-stream-2.0.0.tgz"},"maintainers":[{"name":"freeall","email":"freeall@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/progress-stream-2.0.0.tgz_1491901613134_0.13274514698423445"},"directories":{},"publish_time":1491901614927,"_hasShrinkwrap":false,"_cnpm_publish_time":1491901614927},"1.2.0":{"name":"progress-stream","version":"1.2.0","description":"Read the progress of a stream","repository":{"type":"git","url":"git+ssh://git@github.com/freeall/progress-stream.git"},"keywords":["stream","progress","percentage","percent","download","upload","file","streaming","request","http"],"main":"index.js","dependencies":{"through2":"~0.2.3","speedometer":"~0.1.2"},"devDependencies":{"request":"~2.29.0","single-line-log":"~1.0.0","numeral":"~1.5.2"},"scripts":{"test":"node test/http.js && node test/request.js"},"author":{"name":"freeall","email":"freeall@gmail.com"},"license":"BSD-2-Clause","gitHead":"90a9fab0f71445fbb924ef0b93930863600bf5d9","bugs":{"url":"https://github.com/freeall/progress-stream/issues"},"homepage":"https://github.com/freeall/progress-stream#readme","_id":"progress-stream@1.2.0","_shasum":"2cd3cfea33ba3a89c9c121ec3347abe9ab125f77","_from":".","_npmVersion":"2.14.3","_nodeVersion":"4.1.0","_npmUser":{"name":"freeall","email":"freeall@gmail.com"},"dist":{"shasum":"2cd3cfea33ba3a89c9c121ec3347abe9ab125f77","size":3859,"noattachment":false,"key":"/progress-stream/-/progress-stream-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/progress-stream/download/progress-stream-1.2.0.tgz"},"maintainers":[{"name":"freeall","email":"freeall@gmail.com"}],"directories":{},"publish_time":1448978355553,"_cnpm_publish_time":1448978355553,"_hasShrinkwrap":false},"1.1.2":{"name":"progress-stream","version":"1.1.2","description":"Read the progress of a stream","repository":{"type":"git","url":"git+ssh://git@github.com/freeall/progress-stream.git"},"keywords":["stream","progress","percentage","percent","download","upload","file","streaming","request","http"],"main":"index.js","dependencies":{"through2":"~0.2.3","speedometer":"~0.1.2","single-line-log":"~0.3.1"},"devDependencies":{"request":"~2.29.0","single-line-log":"~0.1.2","numeral":"~1.5.2"},"scripts":{"test":"node test/http.js && node test/request.js"},"author":{"name":"freeall","email":"freeall@gmail.com"},"license":"BSD-2-Clause","gitHead":"f93f925359d1a8108c9cbeb87f22381e988ab4e5","bugs":{"url":"https://github.com/freeall/progress-stream/issues"},"homepage":"https://github.com/freeall/progress-stream#readme","_id":"progress-stream@1.1.2","_shasum":"6e0841182f51c7fe5728ee9c0beb35dd29e60314","_from":".","_npmVersion":"2.14.3","_nodeVersion":"4.1.0","_npmUser":{"name":"freeall","email":"freeall@gmail.com"},"dist":{"shasum":"6e0841182f51c7fe5728ee9c0beb35dd29e60314","size":3094,"noattachment":false,"key":"/progress-stream/-/progress-stream-1.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/progress-stream/download/progress-stream-1.1.2.tgz"},"maintainers":[{"name":"freeall","email":"freeall@gmail.com"}],"directories":{},"publish_time":1448977851184,"_cnpm_publish_time":1448977851184,"_hasShrinkwrap":false},"1.1.1":{"name":"progress-stream","version":"1.1.1","description":"Read the progress of a stream","repository":{"type":"git","url":"git@github.com:freeall/progress-stream.git"},"keywords":["stream","progress","percentage","percent","download","upload","file","streaming","request","http"],"main":"index.js","dependencies":{"through2":"~0.2.3","speedometer":"~0.1.2","single-line-log":"~0.3.1"},"devDependencies":{"request":"~2.29.0","single-line-log":"~0.1.2","numeral":"~1.5.2"},"scripts":{"test":"node test/http.js && node test/request.js"},"author":{"name":"freeall","email":"freeall@gmail.com"},"license":"BSD-2-Clause","gitHead":"1773420828e68656b8cda1990dc65a6ae1e88798","bugs":{"url":"https://github.com/freeall/progress-stream/issues"},"homepage":"https://github.com/freeall/progress-stream","_id":"progress-stream@1.1.1","_shasum":"9ecbf187932c4941d550219190d74dec0ac45f54","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"freeall","email":"freeall@gmail.com"},"maintainers":[{"name":"freeall","email":"freeall@gmail.com"}],"dist":{"shasum":"9ecbf187932c4941d550219190d74dec0ac45f54","size":3117,"noattachment":false,"key":"/progress-stream/-/progress-stream-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/progress-stream/download/progress-stream-1.1.1.tgz"},"directories":{},"publish_time":1428997603156,"_cnpm_publish_time":1428997603156,"_hasShrinkwrap":false},"1.1.0":{"name":"progress-stream","version":"1.1.0","description":"Read the progress of a stream","repository":{"type":"git","url":"git@github.com:freeall/progress-stream.git"},"keywords":["stream","progress","percentage","percent","download","upload","file","streaming","request","http"],"main":"index.js","dependencies":{"through2":"~0.2.3","speedometer":"~0.1.2","single-line-log":"~0.3.1"},"devDependencies":{"request":"~2.29.0","single-line-log":"~0.1.2","numeral":"~1.5.2"},"scripts":{"test":"node test/http.js && node test/request.js"},"author":{"name":"freeall","email":"freeall@gmail.com"},"license":"BSD-2-Clause","gitHead":"7060ff0fedb6a2edeee4fa8ae6650b1a02536d43","bugs":{"url":"https://github.com/freeall/progress-stream/issues"},"homepage":"https://github.com/freeall/progress-stream","_id":"progress-stream@1.1.0","_shasum":"08d1d01663a1502966145772e90b8643af96da0c","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"freeall","email":"freeall@gmail.com"},"maintainers":[{"name":"freeall","email":"freeall@gmail.com"}],"dist":{"shasum":"08d1d01663a1502966145772e90b8643af96da0c","size":3112,"noattachment":false,"key":"/progress-stream/-/progress-stream-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/progress-stream/download/progress-stream-1.1.0.tgz"},"directories":{},"publish_time":1427918957682,"_cnpm_publish_time":1427918957682,"_hasShrinkwrap":false},"1.0.1":{"name":"progress-stream","version":"1.0.1","description":"Read the progress of a stream","repository":{"type":"git","url":"git@github.com:freeall/progress-stream.git"},"keywords":["stream","progress","percentage","percent","download","upload","file","streaming","request","http"],"main":"index.js","dependencies":{"through2":"~0.2.3","speedometer":"~0.1.2","single-line-log":"~0.3.1"},"devDependencies":{"request":"~2.29.0","single-line-log":"~0.1.2","numeral":"~1.5.2"},"scripts":{"test":"node test/http.js && node test/request.js"},"author":{"name":"freeall","email":"freeall@gmail.com"},"license":"BSD-2-Clause","gitHead":"168707c1c8c805b14f10ab7450826cdebc75416b","bugs":{"url":"https://github.com/freeall/progress-stream/issues"},"homepage":"https://github.com/freeall/progress-stream","_id":"progress-stream@1.0.1","_shasum":"2050e62a128383f509af302b540db69a95a91d02","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"freeall","email":"freeall@gmail.com"},"maintainers":[{"name":"freeall","email":"freeall@gmail.com"}],"dist":{"shasum":"2050e62a128383f509af302b540db69a95a91d02","size":3052,"noattachment":false,"key":"/progress-stream/-/progress-stream-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/progress-stream/download/progress-stream-1.0.1.tgz"},"directories":{},"publish_time":1424857856858,"_cnpm_publish_time":1424857856858,"_hasShrinkwrap":false},"1.0.0":{"name":"progress-stream","version":"1.0.0","description":"Read the progress of a stream","repository":{"type":"git","url":"git@github.com:freeall/progress-stream.git"},"keywords":["stream","progress","percentage","percent","download","upload","file","streaming","request","http"],"main":"index.js","dependencies":{"through2":"~0.2.3","speedometer":"~0.1.2","single-line-log":"~0.3.1"},"devDependencies":{"request":"~2.29.0","single-line-log":"~0.1.2","numeral":"~1.5.2"},"scripts":{"test":"node test/http.js && node test/request.js"},"author":{"name":"freeall","email":"freeall@gmail.com"},"license":"BSD-2-Clause","gitHead":"ffa928510d96b6921ff81eda6f3aef0fd8824b2c","bugs":{"url":"https://github.com/freeall/progress-stream/issues"},"homepage":"https://github.com/freeall/progress-stream","_id":"progress-stream@1.0.0","_shasum":"5ae2552b1d7cb772cef2c1e40b5c928bf54c1555","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"freeall","email":"freeall@gmail.com"},"maintainers":[{"name":"freeall","email":"freeall@gmail.com"}],"dist":{"shasum":"5ae2552b1d7cb772cef2c1e40b5c928bf54c1555","size":3048,"noattachment":false,"key":"/progress-stream/-/progress-stream-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/progress-stream/download/progress-stream-1.0.0.tgz"},"directories":{},"publish_time":1424857488285,"_cnpm_publish_time":1424857488285,"_hasShrinkwrap":false},"0.5.0":{"name":"progress-stream","version":"0.5.0","description":"Read the progress of a stream","repository":{"type":"git","url":"git@github.com:freeall/progress-stream.git"},"keywords":["stream","progress","percentage","percent","download","upload","file","streaming","request","http"],"main":"index.js","dependencies":{"through2":"~0.2.3","speedometer":"~0.1.2","single-line-log":"~0.3.1"},"devDependencies":{"request":"~2.29.0","single-line-log":"~0.1.2","numeral":"~1.5.2"},"scripts":{"test":"node test/http.js && node test/request.js"},"author":{"name":"freeall","email":"freeall@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/freeall/progress-stream/issues"},"homepage":"https://github.com/freeall/progress-stream","_id":"progress-stream@0.5.0","_shasum":"cc4759167a6ff4f05876179384f0b6ae0d1d7587","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"freeall","email":"freeall@gmail.com"},"maintainers":[{"name":"freeall","email":"freeall@gmail.com"}],"dist":{"shasum":"cc4759167a6ff4f05876179384f0b6ae0d1d7587","size":3035,"noattachment":false,"key":"/progress-stream/-/progress-stream-0.5.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/progress-stream/download/progress-stream-0.5.0.tgz"},"directories":{},"publish_time":1400059599941,"_cnpm_publish_time":1400059599941,"_hasShrinkwrap":false},"0.4.0":{"name":"progress-stream","version":"0.4.0","description":"Read the progress of a stream","repository":{"type":"git","url":"git@github.com:freeall/progress-stream.git"},"keywords":["stream","progress","percentage","percent","download","upload","file","streaming","request","http"],"main":"index.js","dependencies":{"through2":"~0.2.3","speedometer":"~0.1.2","single-line-log":"~0.3.1"},"devDependencies":{"request":"~2.29.0","single-line-log":"~0.1.2","numeral":"~1.5.2"},"scripts":{"test":"node test/http.js && node test/request.js"},"author":{"name":"freeall","email":"freeall@gmail.com"},"license":"BSD-2-Clause","readmeFilename":"README.md","bugs":{"url":"https://github.com/freeall/progress-stream/issues"},"homepage":"https://github.com/freeall/progress-stream","_id":"progress-stream@0.4.0","dist":{"shasum":"4968ba15bdd8df1d29a7c0102eb95ebc912fd949","size":2712,"noattachment":false,"key":"/progress-stream/-/progress-stream-0.4.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/progress-stream/download/progress-stream-0.4.0.tgz"},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"freeall","email":"freeall@gmail.com"},"maintainers":[{"name":"freeall","email":"freeall@gmail.com"}],"directories":{},"publish_time":1389285137616,"_cnpm_publish_time":1389285137616,"_hasShrinkwrap":false},"0.3.0":{"name":"progress-stream","version":"0.3.0","description":"Read the progress of a stream","repository":{"type":"git","url":"git@github.com:freeall/progress-stream.git"},"keywords":["stream","progress","percentage","percent","download","upload","file","streaming","request","http"],"main":"index.js","dependencies":{"through2":"~0.2.3","speedometer":"~0.1.2"},"devDependencies":{"request":"~2.29.0","single-line-log":"~0.1.2","numeral":"~1.5.2"},"scripts":{"test":"node test/http.js && node test/request.js"},"author":{"name":"freeall","email":"freeall@gmail.com"},"license":"BSD-2-Clause","readmeFilename":"README.md","bugs":{"url":"https://github.com/freeall/progress-stream/issues"},"homepage":"https://github.com/freeall/progress-stream","_id":"progress-stream@0.3.0","dist":{"shasum":"1f40455d8a4f2bd6b64d3c6ff9766c04a39a8a7b","size":2551,"noattachment":false,"key":"/progress-stream/-/progress-stream-0.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/progress-stream/download/progress-stream-0.3.0.tgz"},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"freeall","email":"freeall@gmail.com"},"maintainers":[{"name":"freeall","email":"freeall@gmail.com"}],"directories":{},"publish_time":1386947487550,"_cnpm_publish_time":1386947487550,"_hasShrinkwrap":false},"0.2.1":{"name":"progress-stream","version":"0.2.1","description":"Read the progress of a stream","repository":{"type":"git","url":"git@github.com:freeall/progress-stream.git"},"keywords":["stream","progress","percentage","percent","download","upload","file","streaming","request","http"],"main":"index.js","dependencies":{"through2":"~0.2.3"},"devDependencies":{"request":"~2.29.0","speedometer":"~0.1.2","single-line-log":"~0.1.2","numeral":"~1.5.2"},"scripts":{"test":"node test/http.js && node test/request.js"},"author":{"name":"freeall","email":"freeall@gmail.com"},"license":"BSD-2-Clause","readmeFilename":"README.md","bugs":{"url":"https://github.com/freeall/progress-stream/issues"},"homepage":"https://github.com/freeall/progress-stream","_id":"progress-stream@0.2.1","dist":{"shasum":"9a03bc3d8adc7e07b53cf56c38ee1b146055bc1c","size":2228,"noattachment":false,"key":"/progress-stream/-/progress-stream-0.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/progress-stream/download/progress-stream-0.2.1.tgz"},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"freeall","email":"freeall@gmail.com"},"maintainers":[{"name":"freeall","email":"freeall@gmail.com"}],"directories":{},"publish_time":1386793245202,"_cnpm_publish_time":1386793245202,"_hasShrinkwrap":false},"0.2.0":{"name":"progress-stream","version":"0.2.0","description":"Read the progress of a stream","repository":{"type":"git","url":"git@github.com:freeall/progress-stream.git"},"keywords":["stream","progress","percentage","percent","download","upload","file","streaming","request","http"],"main":"index.js","dependencies":{"through2":"~0.2.3"},"devDependencies":{"request":"~2.29.0","speedometer":"~0.1.2","single-line-log":"~0.1.2","numeral":"~1.5.2"},"scripts":{"test":"node test/http.js && node test/request.js"},"author":{"name":"freeall","email":"freeall@gmail.com"},"license":"BSD-2-Clause","readmeFilename":"README.md","bugs":{"url":"https://github.com/freeall/progress-stream/issues"},"homepage":"https://github.com/freeall/progress-stream","_id":"progress-stream@0.2.0","dist":{"shasum":"01903f96776633d8cfadb947e166b5ce092c361d","size":2124,"noattachment":false,"key":"/progress-stream/-/progress-stream-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/progress-stream/download/progress-stream-0.2.0.tgz"},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"freeall","email":"freeall@gmail.com"},"maintainers":[{"name":"freeall","email":"freeall@gmail.com"}],"directories":{},"publish_time":1386790957226,"_cnpm_publish_time":1386790957226,"_hasShrinkwrap":false},"0.1.1":{"name":"progress-stream","version":"0.1.1","description":"Read the progress of a stream","repository":{"type":"git","url":"git@github.com:freeall/progress-stream.git"},"keywords":["stream","progress","percentage","percent","download","upload","file","streaming","request","http"],"main":"index.js","dependencies":{"through2":"~0.2.3"},"devDependencies":{"request":"~2.29.0","speedometer":"~0.1.2","single-line-log":"~0.1.2","numeral":"~1.5.2"},"scripts":{"test":"node test/http.js && node test/request.js"},"author":{"name":"freeall","email":"freeall@gmail.com"},"license":"BSD-2-Clause","readmeFilename":"README.md","bugs":{"url":"https://github.com/freeall/progress-stream/issues"},"homepage":"https://github.com/freeall/progress-stream","_id":"progress-stream@0.1.1","dist":{"shasum":"7b86be1ffe8776b4cff4f806df1b0b634b5e2a25","size":2043,"noattachment":false,"key":"/progress-stream/-/progress-stream-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/progress-stream/download/progress-stream-0.1.1.tgz"},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"freeall","email":"freeall@gmail.com"},"maintainers":[{"name":"freeall","email":"freeall@gmail.com"}],"directories":{},"publish_time":1386767532001,"_cnpm_publish_time":1386767532001,"_hasShrinkwrap":false},"0.1.0":{"name":"progress-stream","version":"0.1.0","description":"Read the progress of a stream","keywords":["stream","progress","percentage","percent","download","upload","file","streaming","request","http"],"main":"index.js","dependencies":{"through2":"~0.2.3"},"devDependencies":{"request":"~2.29.0","speedometer":"~0.1.2","single-line-log":"~0.1.2","numeral":"~1.5.2"},"scripts":{"test":"node test/http.js && node test/request.js"},"author":{"name":"freeall","email":"freeall@gmail.com"},"license":"BSD-2-Clause","readmeFilename":"README.md","_id":"progress-stream@0.1.0","dist":{"shasum":"8de95f5892f7be2536e347c0d2c1114b52b177da","size":2000,"noattachment":false,"key":"/progress-stream/-/progress-stream-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/progress-stream/download/progress-stream-0.1.0.tgz"},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"freeall","email":"freeall@gmail.com"},"maintainers":[{"name":"freeall","email":"freeall@gmail.com"}],"directories":{},"publish_time":1386767436544,"_cnpm_publish_time":1386767436544,"_hasShrinkwrap":false}},"readme":"# progress-stream\n\nRead the progress of a stream. Supports speed and eta.\n\nGets the length of the stream automatically if you're using the request or http module. You can also pass the length on initiation. Progress-stream will also check to see if the stream already has a length property.\n\n\tnpm install progress-stream\n\n## Usage\n\nThis example copies a large file, and prints out the percentage, speed and remaining every 100ms.\n\n```js\nvar progress = require('progress-stream');\nvar fs = require('fs');\n\nvar stat = fs.statSync(filename);\nvar str = progress({\n\tlength: stat.size,\n\ttime: 100 /* ms */\n});\n\nstr.on('progress', function(progress) {\n\tconsole.log(progress);\n\n\t/*\n\t{\n\t\tpercentage: 9.05,\n\t\ttransferred: 949624,\n\t\tlength: 10485760,\n\t\tremaining: 9536136,\n\t\teta: 42,\n\t\truntime: 3,\n\t\tdelta: 295396,\n\t\tspeed: 949624\n\t}\n\t*/\n});\n\nfs.createReadStream(filename)\n\t.pipe(str)\n\t.pipe(fs.createWriteStream(output));\n```\n\n## Methods\n\n### progress([options], [onprogress])\n\nYou can instantiate in two ways:\n\n``` js\nvar str = progress({time:100});\nstr.on('progress', function(progress) { ... });\n```\n\nor inline the progress listener\n\n``` js\nvar str = progress({time:100}, function(progress) { ... });\n```\n\n## Properties\n\n### .progress()\n\nYou can get the progress from the progress function.\n\n``` js\nvar str = progress({time:100});\n\nconsole.log(str.progress());\n\n/*\n{\n\tpercentage: 9.05,\n\ttransferred: 949624,\n\tlength: 10485760,\n\tremaining: 9536136,\n\teta: 10,\n\truntime: 0,\n\tdelta: 295396,\n\tspeed: 949624\n}\n*/\n```\n\n## Events\n\n### on('progress', function(progress) { ... })\n\n``` js\nvar str = progress({time:100});\nstr.on('progress', function(progress) { ... });\n```\n\n## Options\n\n### time(integer)\n\nSets how often progress events are emitted in ms. If omitted then the default is to do so every time a chunk is received.\n\n### speed(integer)\n\nSets how long the speedometer needs to calculate the speed. Defaults to 5 sec.\n\n### length(integer)\n\nIf you already know the length of the stream, then you can set it. Defaults to 0.\n\n### drain(boolean)\n\nIn case you don't want to include a readstream after progress-stream, set to true to drain automatically. Defaults to false.\n\n### transferred(integer)\n\nIf you want to set the size of previously downloaded data. Useful for a resumed download.\n\n## Examples\n\n### Using the request module\n\nThis example uses request to download a 100 MB file, and writes out the percentage every second.\n\nYou can also find an example in `test/request.js`.\n\n``` js\nvar progress = require('progress-stream');\nvar req = require('request');\nvar fs = require('fs');\n\nvar str = progress({\n\ttime: 1000\n});\n\nstr.on('progress', function(progress) {\n\tconsole.log(Math.round(progress.percentage)+'%');\n});\n\nreq('http://cachefly.cachefly.net/100mb.test', { headers: { 'user-agent': 'test' }})\n\t.pipe(str)\n\t.pipe(fs.createWriteStream('test.data'));\n```\n\n### Using the http module\n\nIn `test/http.js` it's shown how to do it with the http module.\n\n\n## Methods\n\n\n### `setLength(newLength)`\n\nSometimes, you don't know how big a stream is right away (e.g. multipart file uploads).  You might find out after a few chunks have already passed through the stream, seconds or even minutes later.  In this case, you can use the `setLength` method to recalculate the relevant tracked progress data.\n\n```js\nvar str = progress({});\nsomeFickleStreamInstance.pipe(str).pipe(fs.createWriteStream('test.data'));\n\nsomeFickleStreamInstance.on('conviction', function nowIKnowMyLength (actualLength) {\n  str.setLength(actualLength);\n});\n```\n","_attachments":{},"homepage":"https://github.com/freeall/progress-stream#readme","bugs":{"url":"https://github.com/freeall/progress-stream/issues"},"license":"BSD-2-Clause"}