{"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","tarball":"http://registry-npm.ywwl.com/request-capture-har/download/request-capture-har-1.1.3.tgz","integrity":"sha512-1PdZiQ9QslnTpL6ytq4VYwR0H9WSisDBff/Wk/jKfRXJRJaMYVF/3iFIxrcPD+qidXfGFcvAbHjtCCYhYrp1XA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEEqFuT9oNSX7soNjj/rQ/VSgNsB+ZStrozmdflfsN0MAiAbk94wCgqpB3RkvZtjHU0zEMoGn3wYWxeGd6Y5BuNAvg=="}],"size":3018,"noattachment":false,"key":"/request-capture-har/-/request-capture-har-1.1.3.tgz"},"maintainers":[{"name":"paulirish","email":"paul.irish@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/request-capture-har-1.1.3.tgz_1473305692055_0.07969667506404221"},"directories":{},"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","publish_time":1473305693255,"_cnpm_publish_time":1473305693255,"dist-tags":{"latest":"1.2.2"}}