{"name":"responselike","version":"0.2.0","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.19.1","coveralls":"^2.13.1","eslint-config-xo-lukechilds":"^1.0.0","nyc":"^10.3.2","xo":"^0.19.0"},"gitHead":"3b21755458e0fbae4ad51cc2ba672888e97546e7","bugs":{"url":"https://github.com/lukechilds/responselike/issues"},"homepage":"https://github.com/lukechilds/responselike#readme","_id":"responselike@0.2.0","_npmVersion":"5.0.3","_nodeVersion":"8.0.0","_npmUser":{"name":"lukechilds","email":"lukechilds123@gmail.com"},"dist":{"integrity":"sha512-cDn1dhdwkAr3fjk36gC0qB4oU78IdJUl8YKdqTrYzED2O3BWIBGYwxIrWDmC00/Nrn9p3q40icy350fTQgOuxw==","shasum":"81b12fe4b59e4356b41c1f8db8f24dc07db0bace","tarball":"http://registry-npm.ywwl.com/responselike/download/responselike-0.2.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICOl4MGLD/Ld1JZ/MEBKmSFNVZqpHbYzpKogoNgf1QQ/AiAN7ese1yIR3QDE5sczV1hgFqxnzYLNjlXPf1nYIbKYPQ=="}],"size":2423,"noattachment":false,"key":"/responselike/-/responselike-0.2.0.tgz"},"maintainers":[{"name":"lukechilds","email":"lukechilds123@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/responselike-0.2.0.tgz_1497870552306_0.4606168167665601"},"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":1497870552432,"_cnpm_publish_time":1497870552432,"dist-tags":{"latest":"4.0.2"}}