{"_id":"request-capture-har","_rev":"245003","name":"request-capture-har","description":"Wrapper for request module that saves all traffic as a HAR file, useful for auto mocking a client","dist-tags":{"latest":"1.2.2"},"maintainers":[{"name":"paulirish","email":""}],"time":{"modified":"2021-06-03T16:02:32.000Z","created":"2016-08-28T02:20:20.930Z","1.2.2":"2017-03-27T07:40:23.041Z","1.2.1":"2017-03-27T01:01:35.440Z","1.2.0":"2017-03-26T23:47:44.604Z","1.1.4":"2016-09-19T10:41:11.307Z","1.1.3":"2016-09-08T03:34:53.255Z","1.1.2":"2016-09-08T01:55:57.294Z","1.1.0":"2016-09-08T01:33:49.741Z","1.0.2":"2016-08-28T03:26:27.863Z","1.0.1":"2016-08-28T03:19:17.445Z","1.0.0":"2016-08-28T02:20:20.930Z"},"users":{"wuamin":true,"alexxnica":true},"author":{"name":"Lars Thorup","email":"lars@zealake.com","url":"http://github.com/larsthorup"},"repository":{"type":"git","url":"git+https://github.com/paulirish/node-request-capture-har.git"},"versions":{"1.2.2":{"name":"request-capture-har","version":"1.2.2","description":"Wrapper for request module that saves all traffic as a HAR file, useful for auto mocking a client","main":"request-capture-har.js","scripts":{"test":"semistandard","travis":"npm test && node request-capture-har.js"},"repository":{"type":"git","url":"git+https://github.com/paulirish/node-request-capture-har.git"},"keywords":["http","request","har"],"author":{"name":"Lars Thorup","email":"lars@zealake.com","url":"http://github.com/larsthorup"},"license":"MIT","bugs":{"url":"https://github.com/paulirish/node-request-capture-har/issues"},"homepage":"https://github.com/paulirish/node-request-capture-har#readme","files":["request-capture-har.js"],"devDependencies":{"semistandard":"^8.0.0"},"licenseText":"The MIT License (MIT)\n\nCopyright (c) 2016 Lars Thorup\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"request-capture-har@1.2.2","dist":{"shasum":"cd692cfb2cc744fd84a3358aac6ee51528cf720d","size":3380,"noattachment":false,"key":"/request-capture-har/-/request-capture-har-1.2.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/request-capture-har/download/request-capture-har-1.2.2.tgz"},"maintainers":[{"name":"paulirish","email":""}],"_npmUser":{"name":"paulirish","email":"paul.irish@gmail.com"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/request-capture-har-1.2.2.tgz_1490600422810_0.5916916788555682"},"directories":{},"publish_time":1490600423041,"_hasShrinkwrap":false,"_cnpm_publish_time":1490600423041},"1.2.1":{"name":"request-capture-har","version":"1.2.1","description":"Wrapper for request module that saves all traffic as a HAR file, useful for auto mocking a client","main":"request-capture-har.js","scripts":{"test":"semistandard","travis":"npm test && node request-capture-har.js"},"repository":{"type":"git","url":"git+https://github.com/paulirish/node-request-capture-har.git"},"keywords":["http","request","har"],"author":{"name":"Lars Thorup","email":"lars@zealake.com","url":"http://github.com/larsthorup"},"license":"MIT","bugs":{"url":"https://github.com/paulirish/node-request-capture-har/issues"},"homepage":"https://github.com/paulirish/node-request-capture-har#readme","files":["request-capture-har.js"],"devDependencies":{"semistandard":"^8.0.0"},"licenseText":"The MIT License (MIT)\n\nCopyright (c) 2016 Lars Thorup\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"request-capture-har@1.2.1","dist":{"shasum":"2d25162435bbca66593d6f1adc6c578e7def8d5f","size":3390,"noattachment":false,"key":"/request-capture-har/-/request-capture-har-1.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/request-capture-har/download/request-capture-har-1.2.1.tgz"},"maintainers":[{"name":"paulirish","email":""}],"_npmUser":{"name":"paulirish","email":"paul.irish@gmail.com"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/request-capture-har-1.2.1.tgz_1490576495215_0.842642012052238"},"directories":{},"publish_time":1490576495440,"_hasShrinkwrap":false,"_cnpm_publish_time":1490576495440},"1.2.0":{"name":"request-capture-har","version":"1.2.0","description":"Wrapper for request module that saves all traffic as a HAR file, useful for auto mocking a client","main":"request-capture-har.js","scripts":{"test":"semistandard","travis":"npm test"},"repository":{"type":"git","url":"git+https://github.com/paulirish/node-request-capture-har.git"},"keywords":["http","request","har"],"author":{"name":"Lars Thorup","email":"lars@zealake.com","url":"http://github.com/larsthorup"},"license":"MIT","bugs":{"url":"https://github.com/paulirish/node-request-capture-har/issues"},"homepage":"https://github.com/paulirish/node-request-capture-har#readme","files":["request-capture-har.js"],"devDependencies":{"semistandard":"^8.0.0"},"licenseText":"The MIT License (MIT)\n\nCopyright (c) 2016 Lars Thorup\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"request-capture-har@1.2.0","dist":{"shasum":"f8e34cd18c8ba64802141afc54ba008fba342bc0","size":3307,"noattachment":false,"key":"/request-capture-har/-/request-capture-har-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/request-capture-har/download/request-capture-har-1.2.0.tgz"},"maintainers":[{"name":"paulirish","email":""}],"_npmUser":{"name":"paulirish","email":"paul.irish@gmail.com"},"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/request-capture-har-1.2.0.tgz_1490572062895_0.11108247353695333"},"directories":{},"publish_time":1490572064604,"_hasShrinkwrap":false,"_cnpm_publish_time":1490572064604},"1.1.4":{"name":"request-capture-har","version":"1.1.4","description":"Wrapper for request module that saves all traffic as a HAR file, useful for auto mocking a client","main":"request-capture-har.js","scripts":{"test":"semistandard","travis":"npm test"},"repository":{"type":"git","url":"git+https://github.com/paulirish/node-request-capture-har.git"},"keywords":["http","request","har"],"author":{"name":"Lars Thorup","email":"lars@zealake.com","url":"http://github.com/larsthorup"},"license":"MIT","bugs":{"url":"https://github.com/paulirish/node-request-capture-har/issues"},"homepage":"https://github.com/paulirish/node-request-capture-har#readme","files":["request-capture-har.js"],"devDependencies":{"semistandard":"^8.0.0"},"gitHead":"05269986bd55161df7c0c64a2501ab6954df26f1","_id":"request-capture-har@1.1.4","_shasum":"e6ad76eb8e7a1714553fdbeef32cd4518e4e2013","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.4.0","_npmUser":{"name":"paulirish","email":"paul.irish@gmail.com"},"dist":{"shasum":"e6ad76eb8e7a1714553fdbeef32cd4518e4e2013","size":2935,"noattachment":false,"key":"/request-capture-har/-/request-capture-har-1.1.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/request-capture-har/download/request-capture-har-1.1.4.tgz"},"maintainers":[{"name":"paulirish","email":""}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/request-capture-har-1.1.4.tgz_1474281668496_0.5531951230950654"},"directories":{},"publish_time":1474281671307,"_cnpm_publish_time":1474281671307,"_hasShrinkwrap":false},"1.1.3":{"name":"request-capture-har","version":"1.1.3","description":"Wrapper for request module that saves all traffic as a HAR file, useful for auto mocking a client","main":"request-capture-har.js","scripts":{"test":"semistandard","travis":"npm test"},"repository":{"type":"git","url":"git+https://github.com/paulirish/node-request-capture-har.git"},"keywords":["http","request","har"],"author":{"name":"Lars Thorup","email":"lars@zealake.com","url":"http://github.com/larsthorup"},"license":"MIT","bugs":{"url":"https://github.com/paulirish/node-request-capture-har/issues"},"homepage":"https://github.com/paulirish/node-request-capture-har#readme","files":["request-capture-har.js"],"devDependencies":{"semistandard":"^8.0.0"},"gitHead":"c17e0c829e1f4ef75403faa03d7a184c6d2a4d5c","_id":"request-capture-har@1.1.3","_shasum":"9b60ac3b4a5ade93fe2419eee71be212a2748bbc","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.4.0","_npmUser":{"name":"paulirish","email":"paul.irish@gmail.com"},"dist":{"shasum":"9b60ac3b4a5ade93fe2419eee71be212a2748bbc","size":3018,"noattachment":false,"key":"/request-capture-har/-/request-capture-har-1.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/request-capture-har/download/request-capture-har-1.1.3.tgz"},"maintainers":[{"name":"paulirish","email":""}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/request-capture-har-1.1.3.tgz_1473305692055_0.07969667506404221"},"directories":{},"publish_time":1473305693255,"_cnpm_publish_time":1473305693255,"_hasShrinkwrap":false},"1.1.2":{"name":"request-capture-har","version":"1.1.2","description":"Wrapper for request module that saves all traffic as a HAR file, useful for auto mocking a client","main":"request-capture-har.js","scripts":{"test":"semistandard","travis":"npm test"},"repository":{"type":"git","url":"git+https://github.com/paulirish/node-request-capture-har.git"},"keywords":["http","request","har"],"author":{"name":"Lars Thorup","email":"lars@zealake.com","url":"http://github.com/larsthorup"},"license":"MIT","bugs":{"url":"https://github.com/paulirish/node-request-capture-har/issues"},"homepage":"https://github.com/paulirish/node-request-capture-har#readme","files":["request-capture-har.js"],"devDependencies":{"semistandard":"^8.0.0"},"gitHead":"0af891c634fce3f6254659aaeceb66c0bab25103","_id":"request-capture-har@1.1.2","_shasum":"f2ab8213835972a1a426e46a64c5fbc143811f2a","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.4.0","_npmUser":{"name":"paulirish","email":"paul.irish@gmail.com"},"dist":{"shasum":"f2ab8213835972a1a426e46a64c5fbc143811f2a","size":2911,"noattachment":false,"key":"/request-capture-har/-/request-capture-har-1.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/request-capture-har/download/request-capture-har-1.1.2.tgz"},"maintainers":[{"name":"paulirish","email":""}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/request-capture-har-1.1.2.tgz_1473299756098_0.16123513295315206"},"directories":{},"publish_time":1473299757294,"_cnpm_publish_time":1473299757294,"_hasShrinkwrap":false},"1.1.0":{"name":"request-capture-har","version":"1.1.0","description":"Wrapper for request module that saves all traffic as a HAR file, useful for auto mocking a client","main":"request-capture-har.js","scripts":{"test":"semistandard","travis":"npm test"},"repository":{"type":"git","url":"git+https://github.com/paulirish/node-request-capture-har.git"},"keywords":["http","request","har"],"author":{"name":"Lars Thorup","email":"lars@zealake.com","url":"http://github.com/larsthorup"},"license":"MIT","bugs":{"url":"https://github.com/paulirish/node-request-capture-har/issues"},"homepage":"https://github.com/paulirish/node-request-capture-har#readme","files":["request-capture-har.js"],"dependencies":{"request":"^2.67.0"},"devDependencies":{"semistandard":"^8.0.0"},"gitHead":"005264e6016186682a26eac33909dd47a66f7cb6","_id":"request-capture-har@1.1.0","_shasum":"62d676c64d9823066ceaa6d083d530c3a9d025d2","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.4.0","_npmUser":{"name":"paulirish","email":"paul.irish@gmail.com"},"dist":{"shasum":"62d676c64d9823066ceaa6d083d530c3a9d025d2","size":2914,"noattachment":false,"key":"/request-capture-har/-/request-capture-har-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/request-capture-har/download/request-capture-har-1.1.0.tgz"},"maintainers":[{"name":"paulirish","email":""}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/request-capture-har-1.1.0.tgz_1473298428588_0.8717119104694575"},"directories":{},"publish_time":1473298429741,"_cnpm_publish_time":1473298429741,"_hasShrinkwrap":false},"1.0.2":{"name":"request-capture-har","version":"1.0.2","description":"Wrapper for request module that saves all traffic as a HAR file, useful for auto mocking a client","main":"request-capture-har.js","scripts":{"test":"semistandard","travis":"npm test"},"repository":{"type":"git","url":"git+https://github.com/paulirish/node-request-capture-har.git"},"keywords":["http","request","har"],"author":{"name":"Lars Thorup","email":"lars@zealake.com","url":"http://github.com/larsthorup"},"license":"MIT","bugs":{"url":"https://github.com/paulirish/node-request-capture-har/issues"},"homepage":"https://github.com/paulirish/node-request-capture-har#readme","files":["request-capture-har.js"],"dependencies":{"request":"^2.67.0"},"devDependencies":{"semistandard":"^8.0.0"},"gitHead":"fa075b855cb39f71c325a8630e78e06696d91aac","_id":"request-capture-har@1.0.2","_shasum":"ddd3fa0529b8317201a0e73160cfb9b121102aa9","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.4.0","_npmUser":{"name":"paulirish","email":"paul.irish@gmail.com"},"dist":{"shasum":"ddd3fa0529b8317201a0e73160cfb9b121102aa9","size":2932,"noattachment":false,"key":"/request-capture-har/-/request-capture-har-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/request-capture-har/download/request-capture-har-1.0.2.tgz"},"maintainers":[{"name":"paulirish","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/request-capture-har-1.0.2.tgz_1472354787612_0.19927435577847064"},"directories":{},"publish_time":1472354787863,"_cnpm_publish_time":1472354787863,"_hasShrinkwrap":false},"1.0.1":{"name":"request-capture-har","version":"1.0.1","description":"Wrapper for request module that saves all traffic as a HAR file, useful for auto mocking a client","main":"request-capture-har.js","scripts":{"test":"semistandard","travis":"npm test"},"repository":{"type":"git","url":"git+https://github.com/paulirish/node-request-capture-har.git"},"keywords":["http","request","har"],"author":{"name":"Lars Thorup","email":"lars@zealake.com","url":"http://github.com/larsthorup"},"license":"MIT","bugs":{"url":"https://github.com/paulirish/node-request-capture-har/issues"},"homepage":"https://github.com/paulirish/node-request-capture-har#readme","files":["request-capture-har.js"],"dependencies":{"request":"^2.67.0"},"devDependencies":{"semistandard":"^8.0.0"},"gitHead":"17924331482a3177ea2c17b8d4db7d495d55319c","_id":"request-capture-har@1.0.1","_shasum":"7d433fe0563ec3afa931dafa108d0050eb0f9aae","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.4.0","_npmUser":{"name":"paulirish","email":"paul.irish@gmail.com"},"dist":{"shasum":"7d433fe0563ec3afa931dafa108d0050eb0f9aae","size":2804,"noattachment":false,"key":"/request-capture-har/-/request-capture-har-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/request-capture-har/download/request-capture-har-1.0.1.tgz"},"maintainers":[{"name":"paulirish","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/request-capture-har-1.0.1.tgz_1472354357205_0.6577486686874181"},"directories":{},"publish_time":1472354357445,"_cnpm_publish_time":1472354357445,"_hasShrinkwrap":false},"1.0.0":{"name":"request-capture-har","version":"1.0.0","description":"Wrapper for request module that saves all traffic as a HAR file, useful for auto mocking a client","main":"request-capture-har.js","scripts":{"test":"semistandard","travis":"npm test"},"repository":{"type":"git","url":"git+https://github.com/paulirish/node-request-capture-har.git"},"keywords":["http","request","har"],"author":{"name":"Lars Thorup","email":"lars@zealake.com","url":"http://github.com/larsthorup"},"license":"MIT","bugs":{"url":"https://github.com/paulirish/node-request-capture-har/issues"},"homepage":"https://github.com/paulirish/node-request-capture-har#readme","files":["request-capture-har.js"],"dependencies":{"request":"^2.67.0"},"devDependencies":{"semistandard":"^8.0.0"},"gitHead":"6340f06699f6653abe8f792c80c4a87f3215fae3","_id":"request-capture-har@1.0.0","_shasum":"15e9c1b296da1c4b9a14c7768b89b63ddd966202","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.4.0","_npmUser":{"name":"paulirish","email":"paul.irish@gmail.com"},"dist":{"shasum":"15e9c1b296da1c4b9a14c7768b89b63ddd966202","size":2641,"noattachment":false,"key":"/request-capture-har/-/request-capture-har-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/request-capture-har/download/request-capture-har-1.0.0.tgz"},"maintainers":[{"name":"paulirish","email":""}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/request-capture-har-1.0.0.tgz_1472350818646_0.09013220644555986"},"directories":{},"publish_time":1472350820930,"_cnpm_publish_time":1472350820930,"_hasShrinkwrap":false}},"readme":"# request-capture-har\n\n> Wrapper for [`request` module](https://www.npmjs.com/package/request) that saves all network traffic data as a HAR file.\n\n[![Build Status](https://travis-ci.org/paulirish/request-capture-har.png)](https://travis-ci.org/paulirish/request-capture-har) [![NPM request-capture-har package](https://img.shields.io/npm/v/request-capture-har.svg)](https://npmjs.org/package/request-capture-har)\n\n**Compatibility**\n\nrequest >= 2.81.0 recommended, as it has much more detailed timings via `timingPhases`.\n\nrequest >= v2.75.0 required, at a minimum.\n\n### Usage\n\n```js\n// wrap around your request module\nconst RCH = require('request-capture-har');\nconst requestCaptureHar = new RCH(require('request'));\n\n// ...\n// `requestCaptureHar.request` is your `request` module's API.\n// ...\nrequestCaptureHar.request(uri, options, callback);\n\n// Save HAR file to disk\nrequestCaptureHar.saveHar(`network-waterfall_${new Date().toISOString()}.har`);\n\n// You can also clear any collected traffic\nrequestCaptureHar.clearHar();\n```\n\nThis repo is a fork of [larsthorup's `node-request-har-capture`](https://github.com/larsthorup/node-request-har-capture). Instead of monkey-patching `request-promise`, the API allows you to pass in the general `request` module. We also added better support for transfer timings.\n\n![image](https://cloud.githubusercontent.com/assets/39191/18031306/9401070c-6c8f-11e6-994d-03e6b8b511e4.png)\n_Above is a HAR captured by using `request-capture-har` from within `npm` to capture an `npm install`._\n\n### Background\nThis is especially useful for capturing all test traffic from your back-end test suite, for doing auto mocking in your front-end test suite. See this project for an example: https://github.com/larsthorup/http-auto-mock-demo. Blog post about this technique: http://www.zealake.com/2015/01/05/unit-test-your-service-integration-layer/\n","_attachments":{},"homepage":"https://github.com/paulirish/node-request-capture-har#readme","bugs":{"url":"https://github.com/paulirish/node-request-capture-har/issues"},"license":"MIT"}