{"_id":"request-stats","_rev":"27-46b576a5e97e4b6552d469ed9270998b","name":"request-stats","description":"Get stats on your Node.js HTTP server requests","dist-tags":{"latest":"3.0.0"},"versions":{"0.1.0":{"name":"request-stats","version":"0.1.0","description":"Get stats on your Node.js HTTP server requests","main":"index.js","scripts":{"test":"node test.js"},"repository":{"type":"git","url":"git://github.com/watson/request-stats.git"},"keywords":["stats","statistics","http","https","middleware","connect","express","analytics"],"author":{"name":"Thomas Watson Steen","email":"w@tson.dk"},"license":"MIT","bugs":{"url":"https://github.com/watson/request-stats/issues"},"homepage":"https://github.com/watson/request-stats","_id":"request-stats@0.1.0","_shasum":"0e813f6f93270a8830758f2156965ea4d93be1af","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"watson","email":"w@tson.dk"},"maintainers":[{"name":"watson","email":"w@tson.dk"}],"dist":{"shasum":"0e813f6f93270a8830758f2156965ea4d93be1af","tarball":"https://registry.npmjs.org/request-stats/-/request-stats-0.1.0.tgz","integrity":"sha512-nYstvNth7iCzKBfLpLu1rUyPvNf6DrOhK/q+W8geAWhERQYTTbg61FF9Bzjiy0Wmi9S+Zi6UDFqi7E7i/HkDug==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDDyE+RFANM9R4t+ngJI/fGZS6+CDhigDg0qL080IMTGgIgBWbFVcKAizgcjO/nRCtxVhPZbCgFjWLs0mO75HWxS8Y="}]},"directories":{}},"0.2.0":{"name":"request-stats","version":"0.2.0","description":"Get stats on your Node.js HTTP server requests","main":"index.js","scripts":{"test":"node test.js"},"repository":{"type":"git","url":"git://github.com/watson/request-stats.git"},"keywords":["stats","statistics","http","https","middleware","connect","express","analytics"],"author":{"name":"Thomas Watson Steen","email":"w@tson.dk"},"license":"MIT","bugs":{"url":"https://github.com/watson/request-stats/issues"},"homepage":"https://github.com/watson/request-stats","dependencies":{"http-headers":"0.1.x"},"_id":"request-stats@0.2.0","_shasum":"a8e4b5db3e836b968c140f6853b9d4d9bbdd4a81","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"watson","email":"w@tson.dk"},"maintainers":[{"name":"watson","email":"w@tson.dk"}],"dist":{"shasum":"a8e4b5db3e836b968c140f6853b9d4d9bbdd4a81","tarball":"https://registry.npmjs.org/request-stats/-/request-stats-0.2.0.tgz","integrity":"sha512-+A96QCM/PM9qlQw75iKgkqE+PkJooEbFl/+y3jZd1XjJJBYiiABAEosgshLRNA+WeiRciBIrjwJibwTqkEK77g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHkq28K5zx5cXN2xNpXSKkO+B/5J9c8suwK34XjbeDhLAiEAtmTnoLZSWpWmJZyXkjQSgezvcGE04dzLE9z2aMQSXrw="}]},"directories":{}},"0.2.1":{"name":"request-stats","version":"0.2.1","description":"Get stats on your Node.js HTTP server requests","main":"index.js","scripts":{"test":"node test.js"},"repository":{"type":"git","url":"git://github.com/watson/request-stats.git"},"keywords":["stats","statistics","http","https","middleware","connect","express","analytics"],"author":{"name":"Thomas Watson Steen","email":"w@tson.dk"},"license":"MIT","bugs":{"url":"https://github.com/watson/request-stats/issues"},"homepage":"https://github.com/watson/request-stats","dependencies":{"http-headers":"0.1.x"},"_id":"request-stats@0.2.1","_shasum":"97e6490f6ace4cd4d5ab95ec5aabf8c6f7ca416c","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"watson","email":"w@tson.dk"},"maintainers":[{"name":"watson","email":"w@tson.dk"}],"dist":{"shasum":"97e6490f6ace4cd4d5ab95ec5aabf8c6f7ca416c","tarball":"https://registry.npmjs.org/request-stats/-/request-stats-0.2.1.tgz","integrity":"sha512-W1gtSK7KhvgroRztSp/tcJjveeLRqd4Fhq0F7zGj3cA8fcsHlxaoWUw9w8oGny4J4vhc5nlhgWlXDLRviEJzCw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDLYqxl7wL6K5wwK9463kj/FMA9QeOmXtZl3pjZQJ6NoAiATN5HpNnUfFtoar4DPVJRgg0iGqz6MQ+66ZPe4JohOCg=="}]},"directories":{}},"0.2.2":{"name":"request-stats","version":"0.2.2","description":"Get stats on your Node.js HTTP server requests","main":"index.js","scripts":{"test":"node test.js"},"repository":{"type":"git","url":"git://github.com/watson/request-stats.git"},"keywords":["stats","statistics","http","https","middleware","connect","express","analytics"],"author":{"name":"Thomas Watson Steen","email":"w@tson.dk"},"license":"MIT","bugs":{"url":"https://github.com/watson/request-stats/issues"},"homepage":"https://github.com/watson/request-stats","dependencies":{"http-headers":"0.1.x"},"_id":"request-stats@0.2.2","_shasum":"882d5cda7420348451e28de60623204b327046fe","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"watson","email":"w@tson.dk"},"maintainers":[{"name":"watson","email":"w@tson.dk"}],"dist":{"shasum":"882d5cda7420348451e28de60623204b327046fe","tarball":"https://registry.npmjs.org/request-stats/-/request-stats-0.2.2.tgz","integrity":"sha512-optrEWge7Br3+nHFc6lJCJdz+iyRTf00T0bJG9+V+kI3SfaF4vjMjW8FUmJIogLSkmryLHqjs0Om5pPDMHv8XA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD9yCbkJ+soCWJvYToDN/Ct2A2ntTyVrEjNgZI9l3pcpwIgUQRWDFxMBUjngWMkz8jRoOzkF/yrTL9F0vebsvnk2Dk="}]},"directories":{}},"0.3.0":{"name":"request-stats","version":"0.3.0","description":"Get stats on your Node.js HTTP server requests","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git://github.com/watson/request-stats.git"},"keywords":["stats","statistics","http","https","middleware","connect","express","analytics"],"author":{"name":"Thomas Watson Steen","email":"w@tson.dk"},"license":"MIT","bugs":{"url":"https://github.com/watson/request-stats/issues"},"homepage":"https://github.com/watson/request-stats","dependencies":{"http-headers":"0.1.x"},"devDependencies":{"mocha":"1.20.x"},"_id":"request-stats@0.3.0","_shasum":"f77e1e1f086b90af5d74ba3475ad04d02f15ac25","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"watson","email":"w@tson.dk"},"maintainers":[{"name":"watson","email":"w@tson.dk"}],"dist":{"shasum":"f77e1e1f086b90af5d74ba3475ad04d02f15ac25","tarball":"https://registry.npmjs.org/request-stats/-/request-stats-0.3.0.tgz","integrity":"sha512-WjrRGCWCPTHsVNUIwBjcWEI+9jCse1brZvCRtkzt9c+1gI0g86GmFKbrStnhSurGuj5BkaUPpz2sChcuvWuA8g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCVIacHi0y5s1qGiUw1stNQ6Uf1vzqVho+2GK4dyDaO3QIhAIVyls7GQccp3Vm1GYgGRqlLySc8tK1T9s3qTCvYguMx"}]},"directories":{}},"0.3.1":{"name":"request-stats","version":"0.3.1","description":"Get stats on your Node.js HTTP server requests","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git://github.com/watson/request-stats.git"},"keywords":["stats","statistics","http","https","middleware","connect","express","analytics"],"author":{"name":"Thomas Watson Steen","email":"w@tson.dk"},"license":"MIT","bugs":{"url":"https://github.com/watson/request-stats/issues"},"homepage":"https://github.com/watson/request-stats","dependencies":{"http-headers":"0.1.x","once":"1.3.x"},"devDependencies":{"mocha":"1.20.x"},"_id":"request-stats@0.3.1","_shasum":"47411849bba2cc5e69c1720ad2d1221e112c9cdc","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"watson","email":"w@tson.dk"},"maintainers":[{"name":"watson","email":"w@tson.dk"}],"dist":{"shasum":"47411849bba2cc5e69c1720ad2d1221e112c9cdc","tarball":"https://registry.npmjs.org/request-stats/-/request-stats-0.3.1.tgz","integrity":"sha512-/2ceq28E30BGS9yGTlTFCg368u8a7OvTkhlPMoVhSs91iA7U01ubrzlQYijVkYQUHDl/j/UoVAZXvEi3Mn4dOQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAyWdjGdtJdcqsmjj2jxI3+TWKQ1HH5bE9MspuTYW56tAiAoFXnUo44U/mX2Ex+7APDRdRa++ModaCKptmdY2UCT+g=="}]},"directories":{}},"0.3.2":{"name":"request-stats","version":"0.3.2","description":"Get stats on your Node.js HTTP server requests","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git://github.com/watson/request-stats.git"},"keywords":["stats","statistics","http","https","middleware","connect","express","analytics"],"author":{"name":"Thomas Watson Steen","email":"w@tson.dk"},"license":"MIT","bugs":{"url":"https://github.com/watson/request-stats/issues"},"homepage":"https://github.com/watson/request-stats","dependencies":{"http-headers":"0.1.x","once":"1.3.x"},"devDependencies":{"mocha":"1.20.x"},"_id":"request-stats@0.3.2","_shasum":"7dcd6c1406ff976e3fad61664710ac97117bf0db","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"watson","email":"w@tson.dk"},"maintainers":[{"name":"watson","email":"w@tson.dk"}],"dist":{"shasum":"7dcd6c1406ff976e3fad61664710ac97117bf0db","tarball":"https://registry.npmjs.org/request-stats/-/request-stats-0.3.2.tgz","integrity":"sha512-J9o0Nn7E3G6+KMvD3e5aZtHkKUkrnCN+qlPBQEOtp3rgX/gtFH4sy84X2fqjXVz1kF5AMBxAX4ooDvo66uOqiw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCARvoqiR0l8a9BToxzZ3sPnIPGlsyoYdeNIfvejkKW/QIgNXaEMX2D1dFEzCEe49Cot7ljZlFsN3CF85vke8/dAlo="}]},"directories":{}},"1.0.0":{"name":"request-stats","version":"1.0.0","description":"Get stats on your Node.js HTTP server requests","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git://github.com/watson/request-stats.git"},"keywords":["stats","statistics","http","https","middleware","connect","express","analytics"],"author":{"name":"Thomas Watson Steen","email":"w@tson.dk"},"license":"MIT","bugs":{"url":"https://github.com/watson/request-stats/issues"},"homepage":"https://github.com/watson/request-stats","dependencies":{"http-headers":"0.1.x","once":"1.3.x"},"devDependencies":{"mocha":"1.20.x"},"gitHead":"f0bb3d1742b4c5571dc1e4821d31402adfc479b1","_id":"request-stats@1.0.0","_shasum":"cc5fa81ff3f5ec340852a2db15ca21d0c1b896d6","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"watson","email":"w@tson.dk"},"maintainers":[{"name":"watson","email":"w@tson.dk"}],"dist":{"shasum":"cc5fa81ff3f5ec340852a2db15ca21d0c1b896d6","tarball":"https://registry.npmjs.org/request-stats/-/request-stats-1.0.0.tgz","integrity":"sha512-PwZdzdmCtr+FJng+M1XcYLQcVqvop9OyfjPAZh+CXsi7pIZElNhy5V2NTkY8dJLnS5HxCJ5IHq82Jc0g20ZlYw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGvlRAB9r6LDBgf0JrvbfR5If7dFTPkwW7BCGx2jnEyJAiEAgUG0Y/XLME0spuHDRYrwpzDWh4TZ5+uMC2LrJYazYGw="}]},"directories":{}},"1.0.1":{"name":"request-stats","version":"1.0.1","description":"Get stats on your Node.js HTTP server requests","main":"index.js","scripts":{"test":"mocha"},"repository":{"type":"git","url":"git://github.com/watson/request-stats.git"},"keywords":["stats","statistics","http","https","middleware","connect","express","analytics"],"author":{"name":"Thomas Watson Steen","email":"w@tson.dk"},"license":"MIT","bugs":{"url":"https://github.com/watson/request-stats/issues"},"homepage":"https://github.com/watson/request-stats","dependencies":{"http-headers":"0.1.x","once":"1.3.x"},"devDependencies":{"keep-alive-agent":"0.0.1","mocha":"1.21.x"},"gitHead":"fe4c10806c06caabe8777feeb08e5f9980b8060e","_id":"request-stats@1.0.1","_shasum":"7dbad4090caa5f5a0ea179ac80dbc584f74a7bf5","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"watson","email":"w@tson.dk"},"maintainers":[{"name":"watson","email":"w@tson.dk"}],"dist":{"shasum":"7dbad4090caa5f5a0ea179ac80dbc584f74a7bf5","tarball":"https://registry.npmjs.org/request-stats/-/request-stats-1.0.1.tgz","integrity":"sha512-TMAdwD1pHMRy5idxfm884nM3BROPrX2chQCvcBgRnUNE9UGF+XSx0VZUlnCmyf5ktqaRxOlubjoaipudx0dBiw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGca6lB/YcVoKE4/9RnWtAiWLD1hOiktAH4yCV2WdFMdAiBDv3Kbri5VBKmc++EkelitxeIOIBqvgUWFy6NAsWgqsg=="}]},"directories":{}},"2.0.0":{"name":"request-stats","version":"2.0.0","description":"Get stats on your Node.js HTTP server requests","main":"index.js","scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git://github.com/watson/request-stats.git"},"keywords":["stats","statistics","http","https","middleware","connect","express","analytics"],"author":{"name":"Thomas Watson Steen","email":"w@tson.dk"},"license":"MIT","bugs":{"url":"https://github.com/watson/request-stats/issues"},"homepage":"https://github.com/watson/request-stats","dependencies":{"http-headers":"^3.0.1","once":"^1.4.0"},"devDependencies":{"keep-alive-agent":"^0.0.1","standard":"^8.6.0","tape":"^4.6.3"},"coordinates":[55.6810207,12.5644253],"gitHead":"8066391275f0911c30cd0f698cb002ec5e0aaac0","_id":"request-stats@2.0.0","_shasum":"585d22bd1d73023d4e2653ffd6c7e98e7aeab8ea","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"watson","email":"w@tson.dk"},"maintainers":[{"name":"watson","email":"w@tson.dk"}],"dist":{"shasum":"585d22bd1d73023d4e2653ffd6c7e98e7aeab8ea","tarball":"https://registry.npmjs.org/request-stats/-/request-stats-2.0.0.tgz","integrity":"sha512-Jg38478KxIGQ/b3wKxBMWzRivt9DV9iHhBmiCgamxCPcZy8w4j568JZawU3whKU2AQlQ4UgyfehCom+NXwaU4A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDjFCBIgHkNmTqXb12zAZ0wl+uQxNrELAUlb2Tei1rA7AIhAL5KRCaTEAGD1LDh6E3JC5jGlQ5XQwL8snDgEk8MxJ+4"}]},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/request-stats-2.0.0.tgz_1479982176254_0.07056340808048844"},"directories":{}},"2.0.1":{"name":"request-stats","version":"2.0.1","description":"Get stats on your Node.js HTTP server requests","main":"index.js","scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git://github.com/watson/request-stats.git"},"keywords":["stats","statistics","http","https","middleware","connect","express","analytics"],"author":{"name":"Thomas Watson Steen","email":"w@tson.dk"},"license":"MIT","bugs":{"url":"https://github.com/watson/request-stats/issues"},"homepage":"https://github.com/watson/request-stats","dependencies":{"http-headers":"^3.0.1","once":"^1.4.0"},"devDependencies":{"keep-alive-agent":"^0.0.1","standard":"^8.6.0","tape":"^4.6.3"},"coordinates":[55.7775770796403,12.59000686560671],"gitHead":"6494004d832a5b46a909bb8b6ac9b716d9975c17","_id":"request-stats@2.0.1","_shasum":"ed9a6381566af6bbd60fe2d5cfaf46f912b8b03e","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.9.1","_npmUser":{"name":"watson","email":"w@tson.dk"},"maintainers":[{"name":"watson","email":"w@tson.dk"}],"dist":{"shasum":"ed9a6381566af6bbd60fe2d5cfaf46f912b8b03e","tarball":"https://registry.npmjs.org/request-stats/-/request-stats-2.0.1.tgz","integrity":"sha512-GZQvTZqbUx9gXrRfj1c9pMcFzyLeJEpV2P5qXxGwf1I2ZRswRsCNYPsuwnFLNRZQamlsrinzKQnExXBGgFzFCw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB0RBdH/Vf4O0MRz7ia1KDIHBQb1td6q0SNC1NI+p+UrAiBBnA2d2xfBO9VJ0gvKGDfYr85FF/Todx7RUT8mRSyDOQ=="}]},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/request-stats-2.0.1.tgz_1481839455827_0.01629171916283667"},"directories":{}},"3.0.0":{"name":"request-stats","version":"3.0.0","description":"Get stats on your Node.js HTTP server requests","main":"index.js","scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git://github.com/watson/request-stats.git"},"keywords":["stats","statistics","http","https","middleware","connect","express","analytics"],"author":{"name":"Thomas Watson Steen","email":"w@tson.dk"},"license":"MIT","bugs":{"url":"https://github.com/watson/request-stats/issues"},"homepage":"https://github.com/watson/request-stats","dependencies":{"http-headers":"^3.0.1","once":"^1.4.0"},"devDependencies":{"https-pem":"^1.0.4","keep-alive-agent":"^0.0.1","standard":"^8.6.0","tape":"^4.6.3"},"engines":{"node":">=0.12"},"coordinates":[55.6811129,12.564524],"gitHead":"3ee1f52cb7777da424ff6c25f7e2b610664cc7be","_id":"request-stats@3.0.0","_shasum":"769155dc8974d78d4a1cb87bbf14eaab985afe25","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.8.0","_npmUser":{"name":"watson","email":"w@tson.dk"},"maintainers":[{"name":"watson","email":"w@tson.dk"}],"dist":{"shasum":"769155dc8974d78d4a1cb87bbf14eaab985afe25","tarball":"https://registry.npmjs.org/request-stats/-/request-stats-3.0.0.tgz","integrity":"sha512-yhnHqXbmgjQs0q/3ZRUzaWTpmaRX78w1Su6UJaWy4h/EGicimIUDkMce7TZdJaXjOWy7bjqC7RXP9ZBXeBJzIw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDnI+KoXmrZIg6jeHNUkrORuQk0UuXabpOnEP9GVPnzowIhAKdsH9to47CCUAcncZwjguqQDMlzDMbtGLo6UPulebGo"}]},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/request-stats-3.0.0.tgz_1493644433935_0.5643991858232766"},"directories":{}}},"readme":"# request-stats\n\n[![Build status](https://travis-ci.org/watson/request-stats.svg?branch=master)](https://travis-ci.org/watson/request-stats)\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)\n\nGet stats on your Node.js HTTP server requests.\n\nEmits two events:\n\n- `request` when ever a request starts: Passes a [Request object](#request-object) that can later be used to [query for the progress](#progress) of a long running request\n- `complete` when ever a request completes: Passes a [stats object](#oncomplete-callback) containing the overall stats for the entire HTTP request\n\n## Installation\n\n```\nnpm install request-stats --save\n```\n\n## Example usage\n\nGet stats for each completed HTTP request:\n\n```javascript\nvar requestStats = require('request-stats')\nvar server = http.createServer(...)\n\nrequestStats(server, function (stats) {\n  // this function will be called every time a request to the server completes\n  console.log(stats)\n})\n```\n\nGet periodic stats for long running requests:\n\n```javascript\nvar server = http.createServer(...)\n\nvar stats = requestStats(server)\n\nstats.on('request', function (req) {\n  // evey second, print stats\n  var interval = setInterval(function () {\n    var progress = req.progress()\n    console.log(progress)\n    if (progress.completed) clearInterval(interval)\n  }, 1000)\n})\n```\n\n## API\n\n### Constructor\n\n#### `requestStats(server[, callback])`\n\nAttach request-stats to a HTTP server.\n\nInitialize request-stats with an instance a HTTP server. Returns a\nStatsEmitter object. Optionally provide a callback which will be called\nfor each completed HTTP request with a stats object (see stats object\ndetails below).\n\nIf no callback is provided, you can later attach a listener on the\n\"complete\" event.\n\n#### `requestStats(req, res[, callback])`\n\nAttach request-stats to a single HTTP request.\n\nInitialize request-stats with an instance a HTTP request and response.\nReturns a StatsEmitter object. Optionally provide a callback which will\nbe called with a stats object when the HTTP request completes (see stats\nobject details below).\n\nIf no callback is provided, you can later attach a listener on the\n\"complete\" event.\n\n### StatsEmitter object\n\n#### `.on('complete', callback)`\n\nCalls the callback function with a stats object when a HTTP request\ncompletes:\n\n```javascript\n{\n  ok: true,           // `true` if the connection was closed correctly and `false` otherwise\n  time: 0,            // The milliseconds it took to serve the request\n  req: {\n    bytes: 0,         // Number of bytes sent by the client\n    headers: { ... }, // The headers sent by the client\n    method: 'POST',   // The HTTP method used by the client\n    path: '...',      // The path part of the request URL\n    ip: '...',        // The remote ip\n    raw: [Object]     // The original `http.IncomingMessage` object\n  },\n  res: {\n    bytes: 0,         // Number of bytes sent back to the client\n    headers: { ... }, // The headers sent back to the client\n    status: 200,      // The HTTP status code returned to the client\n    raw: [Object]     // The original `http.ServerResponse` object\n  }\n}\n```\n\n#### `.on('request', callback)`\n\nCalls the callback function with a special [Request\nobject](#request-object) when a HTTP request is made to the server.\n\n### Request object\n\nThe Request object should not be confused with the Node.js\n[http.IncomingMessage](http://nodejs.org/api/http.html#http_http_incomingmessage)\nobject. The request-stats Request object provides only a single\nbut powerfull function:\n\n#### `.progress()`\n\nReturns a progress object if called while a HTTP request is in progress.\nIf called multiple times, the returned progress object will contain the\ndelta of the previous call to `.progress()`.\n\n```javascript\n{\n  completed: false, // `false` if the request is still in progress\n  time: 0,          // The total time the reuqest have been in progress\n  timeDelta: 0,     // The time since previous call to .progress()\n  req: {\n    bytes: 0,       // Total bytes received\n    bytesDelta: 0,  // Bytes received since previous call to .progress()\n    speed: 0,       // Bytes per second calculated since previous call to .progress()\n    bytesLeft: 0,   // If the request contains a Content-Size header\n    timeLeft: 0     // If the request contains a Content-Size header\n  },\n  res: {\n    bytes: 0,       // Total bytes send back to the client\n    bytesDelta: 0,  // Bytes sent back to the client since previous call to .progress()\n    speed: 0        // Bytes per second calculated since previous call to .progress()\n  }\n}\n```\n\n## Acknowledgement\n\nThanks to [mafintosh](https://github.com/mafintosh) for coming up with\nthe initial concept and pointing me in the right direction.\n\n## License\n\nMIT\n","maintainers":[{"name":"watson","email":"w@tson.dk"}],"time":{"modified":"2022-06-26T11:33:22.793Z","created":"2014-06-09T15:50:53.669Z","0.1.0":"2014-06-09T15:50:53.669Z","0.2.0":"2014-06-10T08:12:54.068Z","0.2.1":"2014-06-10T08:20:47.607Z","0.2.2":"2014-06-10T10:03:25.392Z","0.3.0":"2014-06-16T08:10:11.847Z","0.3.1":"2014-06-20T12:03:17.138Z","0.3.2":"2014-07-11T13:10:24.978Z","1.0.0":"2014-08-10T09:12:21.147Z","1.0.1":"2014-08-12T15:16:51.605Z","2.0.0":"2016-11-24T10:09:36.838Z","2.0.1":"2016-12-15T22:04:17.676Z","3.0.0":"2017-05-01T13:13:54.663Z"},"homepage":"https://github.com/watson/request-stats","keywords":["stats","statistics","http","https","middleware","connect","express","analytics"],"repository":{"type":"git","url":"git://github.com/watson/request-stats.git"},"author":{"name":"Thomas Watson Steen","email":"w@tson.dk"},"bugs":{"url":"https://github.com/watson/request-stats/issues"},"license":"MIT","readmeFilename":"README.md","users":{"aj888907":true,"rocket0191":true}}