{ "_args": [ [ { "raw": "request-progress@^3.0.0", "scope": null, "escapedName": "request-progress", "name": "request-progress", "rawSpec": "^3.0.0", "spec": ">=3.0.0 <4.0.0", "type": "range" }, "/home/jdaugherty/work/GT2/GT2-Android/node_modules/xdl" ] ], "_from": "request-progress@>=3.0.0 <4.0.0", "_id": "request-progress@3.0.0", "_inCache": true, "_location": "/request-progress", "_nodeVersion": "7.0.0", "_npmOperationalInternal": { "host": "packages-18-east.internal.npmjs.com", "tmp": "tmp/request-progress-3.0.0.tgz_1480622408929_0.9601270244456828" }, "_npmUser": { "name": "satazor", "email": "andremiguelcruz@msn.com" }, "_npmVersion": "3.10.8", "_phantomChildren": {}, "_requested": { "raw": "request-progress@^3.0.0", "scope": null, "escapedName": "request-progress", "name": "request-progress", "rawSpec": "^3.0.0", "spec": ">=3.0.0 <4.0.0", "type": "range" }, "_requiredBy": [ "/xdl" ], "_resolved": "https://registry.npmjs.org/request-progress/-/request-progress-3.0.0.tgz", "_shasum": "4ca754081c7fec63f505e4faa825aa06cd669dbe", "_shrinkwrap": null, "_spec": "request-progress@^3.0.0", "_where": "/home/jdaugherty/work/GT2/GT2-Android/node_modules/xdl", "author": { "name": "IndigoUnited", "email": "hello@indigounited.com", "url": "http://indigounited.com" }, "bugs": { "url": "http://github.com/IndigoUnited/node-request-progress/issues" }, "dependencies": { "throttleit": "^1.0.0" }, "description": "Tracks the download progress of a request made with mikeal/request, giving insight of various metrics including progress percent, download speed and time remaining", "devDependencies": { "coveralls": "^2.11.6", "expect.js": "^0.3.1", "istanbul": "^0.4.1", "mocha": "^3.0.2" }, "directories": {}, "dist": { "shasum": "4ca754081c7fec63f505e4faa825aa06cd669dbe", "tarball": "https://registry.npmjs.org/request-progress/-/request-progress-3.0.0.tgz" }, "gitHead": "329976448037eaef4c1af2c28690067adba91d07", "homepage": "https://github.com/IndigoUnited/node-request-progress#readme", "keywords": [ "progress", "request", "mikeal", "size", "bytes", "percent", "percentage", "speed", "eta", "etr" ], "license": "MIT", "main": "index.js", "maintainers": [ { "name": "satazor", "email": "andremiguelcruz@msn.com" } ], "name": "request-progress", "optionalDependencies": {}, "readme": "# request-progress\n\n[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Dependency status][david-dm-image]][david-dm-url] [![Dev Dependency status][david-dm-dev-image]][david-dm-dev-url]\n\n[npm-url]:https://npmjs.org/package/request-progress\n[downloads-image]:http://img.shields.io/npm/dm/request-progress.svg\n[npm-image]:http://img.shields.io/npm/v/request-progress.svg\n[travis-url]:https://travis-ci.org/IndigoUnited/node-request-progress\n[travis-image]:http://img.shields.io/travis/IndigoUnited/node-request-progress/master.svg\n[coveralls-url]:https://coveralls.io/r/IndigoUnited/node-request-progress\n[coveralls-image]:https://img.shields.io/coveralls/IndigoUnited/node-request-progress/master.svg\n[david-dm-url]:https://david-dm.org/IndigoUnited/node-request-progress\n[david-dm-image]:https://img.shields.io/david/IndigoUnited/node-request-progress.svg\n[david-dm-dev-url]:https://david-dm.org/IndigoUnited/node-request-progress#info=devDependencies\n[david-dm-dev-image]:https://img.shields.io/david/dev/IndigoUnited/node-request-progress.svg\n\nTracks the download progress of a request made with [request](https://github.com/mikeal/request), giving insight of various metrics including progress percentage, download speed and time remaining.\n\n\n## Installation\n\n`$ npm install request-progress`\n\n\n## Usage\n\n```js\nvar fs = require('fs');\nvar request = require('request');\nvar progress = require('request-progress');\n\n// The options argument is optional so you can omit it\nprogress(request('https://az412801.vo.msecnd.net/vhd/VMBuild_20141027/VirtualBox/IE11/Windows/IE11.Win8.1.For.Windows.VirtualBox.zip'), {\n // throttle: 2000, // Throttle the progress event to 2000ms, defaults to 1000ms\n // delay: 1000, // Only start to emit after 1000ms delay, defaults to 0ms\n // lengthHeader: 'x-transfer-length' // Length header to use, defaults to content-length\n})\n.on('progress', function (state) {\n // The state is an object that looks like this:\n // {\n // percent: 0.5, // Overall percent (between 0 to 1)\n // speed: 554732, // The download speed in bytes/sec\n // size: {\n // total: 90044871, // The total payload size in bytes\n // transferred: 27610959 // The transferred payload size in bytes\n // },\n // time: {\n // elapsed: 36.235, // The total elapsed seconds since the start (3 decimals)\n // remaining: 81.403 // The remaining seconds to finish (3 decimals)\n // }\n // }\n console.log('progress', state);\n})\n.on('error', function (err) {\n // Do something with err\n})\n.on('end', function () {\n // Do something after request finishes\n})\n.pipe(fs.createWriteStream('IE11.Win8.1.For.Windows.VirtualBox.zip'));\n```\n\nIf the request's response does not include the `content-length` header, the values of some metrics will be `null`.\nAlso `speed` and `time.remaining` will be `null` until it can be calculated.\n\nThe `state` object emitted in the `progress` event is reused to avoid creating a new object for each event. \nIf you wish to peek the `state` object at any time, it is available in `request.progressState`.\n\n\n## Tests\n\n`$ npm test` \n`$ npm test-cov` to get coverage report\n\n\n## License\n\nReleased under the [MIT License](http://www.opensource.org/licenses/mit-license.php).\n", "readmeFilename": "README.md", "repository": { "type": "git", "url": "git://github.com/IndigoUnited/node-request-progress.git" }, "scripts": { "test": "mocha --bail", "test-cov": "istanbul cover --dir test/coverage _mocha -- --bail && echo open test/coverage/lcov-report/index.html", "test-travis": "istanbul cover _mocha --report lcovonly -- --bail && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js" }, "version": "3.0.0" }