{"name":"responselike","version":"1.0.1","description":"A response-like object for mocking a Node.js HTTP response stream","main":"src/index.js","scripts":{"test":"xo && nyc ava","coverage":"nyc report --reporter=text-lcov | coveralls"},"xo":{"extends":"xo-lukechilds"},"keywords":["http","https","response","mock","request","responselike"],"repository":{"type":"git","url":"git+https://github.com/lukechilds/responselike.git"},"author":{"name":"lukechilds"},"license":"MIT","devDependencies":{"ava":"^0.20.0","coveralls":"^2.13.1","eslint-config-xo-lukechilds":"^1.0.0","get-stream":"^3.0.0","nyc":"^11.0.3","xo":"^0.19.0"},"dependencies":{"lowercase-keys":"^1.0.0"},"gitHead":"0d59bc473f63d2155aa0ff24d81951d134a74ea2","bugs":{"url":"https://github.com/lukechilds/responselike/issues"},"homepage":"https://github.com/lukechilds/responselike#readme","_id":"responselike@1.0.1","_shasum":"7af77f584979e9aee316d5a8923c762bbc0f90d8","_from":".","_npmVersion":"4.6.1","_nodeVersion":"8.1.2","_npmUser":{"name":"lukechilds","email":"lukechilds123@gmail.com"},"dist":{"shasum":"7af77f584979e9aee316d5a8923c762bbc0f90d8","tarball":"http://registry-npm.ywwl.com/responselike/download/responselike-1.0.1.tgz","integrity":"sha512-cRg0EuVN2JQvxVRY/OP5S+U8ahRl1YuXEZmKWFbF9zsC5rBv8mlB4lsHxDh+vbpEAQVfTv67Y48ZWVVuPjJuzQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAVa/0OVPGhha0CeAamh3L0nbNOd6cFzB5tdCzolw/RYAiEAt6q9ykZC/DipmxFY4UiEjQNRNUYbYwHJHucgoz1R5I8="}],"size":3480,"noattachment":false,"key":"/responselike/-/responselike-1.0.1.tgz"},"maintainers":[{"name":"lukechilds","email":"lukechilds123@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/responselike-1.0.1.tgz_1498827878831_0.5962018952704966"},"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":1498827879730,"_cnpm_publish_time":1498827879730,"dist-tags":{"latest":"4.0.2"}}