{"name":"responselike","version":"0.1.0","description":"A response-like object for mocking a native Node.js HTTP response","keywords":["http","https","response","request","responselike"],"scripts":{"test":"node test"},"repository":{"type":"git","url":"git+https://github.com/lukechilds/responselike.git"},"author":{"name":"lukechilds"},"license":"MIT","gitHead":"603af7088210b166764883e84c3d4b6ac495ab53","bugs":{"url":"https://github.com/lukechilds/responselike/issues"},"homepage":"https://github.com/lukechilds/responselike#readme","_id":"responselike@0.1.0","_shasum":"93684efcea96d2c1e96f88a1dbec48d5cc1e5ebd","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.7.0","_npmUser":{"name":"lukechilds","email":"lukechilds123@gmail.com"},"dist":{"shasum":"93684efcea96d2c1e96f88a1dbec48d5cc1e5ebd","tarball":"http://registry-npm.ywwl.com/responselike/download/responselike-0.1.0.tgz","integrity":"sha512-r1+s1Fv6ueVUxyO00sUY36Ti6Jbbj3Q6zce8VUxbosmt2KiX+QbpaYCkgrepvs8zUZo/ScnjS0vHELFkDw4Kvg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBDFk08Qvh88lM7FvC4uocbdA+LGdPYj1ERVmK24Fk6VAiBOgi8/9m5Q9Wiysu7oN21PKSi3frpIm+i2yTB838yjRg=="}],"size":2425,"noattachment":false,"key":"/responselike/-/responselike-0.1.0.tgz"},"maintainers":[{"name":"lukechilds","email":"lukechilds123@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/responselike-0.1.0.tgz_1493884273503_0.28556131827645004"},"directories":{},"readme":"# responselike\n\n> A response-like object for mocking a Node.js HTTP response stream\n\nReturns a streamable response object similar to a [Node.js HTTP response stream](https://nodejs.org/api/http.html#http_class_http_incomingmessage). Useful for formatting cached responses so they can be consumed by code expecting a real response.\n\n## Install\n\n```sh\nnpm install responselike\n```\n\n## Usage\n\n```js\nimport Response from 'responselike';\n\nconst response = new Response({\n\tstatusCode: 200,\n\theaders: {\n\t\tfoo: 'bar'\n\t},\n\tbody: Buffer.from('Hi!'),\n\turl: 'https://example.com'\n});\n\nresponse.statusCode;\n// 200\n\nresponse.headers;\n// {foo: 'bar'}\n\nresponse.body;\n// <Buffer 48 69 21>\n\nresponse.url;\n// 'https://example.com'\n\nresponse.pipe(process.stdout);\n// 'Hi!'\n```\n\n## API\n\n### new Response(options?)\n\nReturns a streamable response object similar to a [Node.js HTTP response stream](https://nodejs.org/api/http.html#http_class_http_incomingmessage).\n\n#### options\n\nType: `object`\n\n##### statusCode\n\nType: `number`\n\nThe HTTP response status code.\n\n##### headers\n\nType: `object`\n\nThe HTTP headers. Keys will be automatically lowercased.\n\n##### body\n\nType: `Buffer`\n\nThe response body. The Buffer contents will be streamable but is also exposed directly as `response.body`.\n\n##### url\n\nType: `string`\n\nThe request URL string.\n","publish_time":1493884275890,"_cnpm_publish_time":1493884275890,"dist-tags":{"latest":"4.0.2"}}