{"name":"responselike","version":"1.0.2","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.22.0","coveralls":"^2.13.1","eslint-config-xo-lukechilds":"^1.0.0","get-stream":"^3.0.0","nyc":"^11.1.0","xo":"^0.19.0"},"dependencies":{"lowercase-keys":"^1.0.0"},"gitHead":"69366dfd6e161b46bc4503c114d067b87e30dd60","bugs":{"url":"https://github.com/lukechilds/responselike/issues"},"homepage":"https://github.com/lukechilds/responselike#readme","_id":"responselike@1.0.2","_shasum":"918720ef3b631c5642be068f15ade5a46f4ba1e7","_from":".","_npmVersion":"4.6.1","_nodeVersion":"8.4.0","_npmUser":{"name":"lukechilds","email":"lukechilds123@gmail.com"},"dist":{"shasum":"918720ef3b631c5642be068f15ade5a46f4ba1e7","tarball":"http://registry-npm.ywwl.com/responselike/download/responselike-1.0.2.tgz","integrity":"sha512-/Fpe5guzJk1gPqdJLJR5u7eG/gNY4nImjbRDaVWVMRhne55TCmj2i9Q+54PBRfatRC8v/rIiv9BN0pMd9OV5EQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG8hTy9GgA2v1okocONuClb24mHaskOC7OYuGQKXBuvgAiEA7nDKBQxuQuuLmfQqfwwlEH94eYaPJFeJ1BjXTCCMtUQ="}],"size":2190,"noattachment":false,"key":"/responselike/-/responselike-1.0.2.tgz"},"maintainers":[{"name":"lukechilds","email":"lukechilds123@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/responselike-1.0.2.tgz_1502988434730_0.1581996688619256"},"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":1502988435629,"_cnpm_publish_time":1502988435629,"dist-tags":{"latest":"4.0.2"}}