{"name":"responselike","version":"2.0.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.25.0","coveralls":"^3.0.0","eslint-config-xo-lukechilds":"^1.0.0","get-stream":"^3.0.0","nyc":"^11.8.0","xo":"^0.19.0"},"dependencies":{"lowercase-keys":"^2.0.0"},"gitHead":"6dff4cd69cfc91710dc9864e26d3a3dff558376a","bugs":{"url":"https://github.com/lukechilds/responselike/issues"},"homepage":"https://github.com/lukechilds/responselike#readme","_id":"responselike@2.0.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.2","dist":{"integrity":"sha512-xH48u3FTB9VsZw7R+vvgaKeLKzT6jOogbQhEe/jewwnZgzPcnyWui2Av6JpoYZF/91uueC+lqhWqeURw5/qhCw==","shasum":"26391bcc3174f750f9a79eacc40a12a5c42d7723","tarball":"http://registry-npm.ywwl.com/responselike/download/responselike-2.0.0.tgz","fileCount":4,"unpackedSize":4626,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdnQooCRA9TVsSAnZWagAAJy8P/iYRnJqTgkCPFJ/JbQVS\n0WIVX62VbUjgBuCPZtY1sc55fENFgyamx9zP54FVPCT3mui/ozPLXp+jqwu1\nMlGPhvGKoUKdbIbDYHeVkge+77RbuIE+f8tQ3pv40Ig6yrnnsKQTO7P99W4R\ndZb+RbpWbvdOfGGVurZdIoCNQm0nKbiWkQE3G6vypVlIHxsI4YQP9FUPxkbi\nikDvA2kYN2mlel4JecgMQ2Z1H1KmeoFHItleGyCsqFMFLH1KCcKJCV8BY+NQ\nXM9wmL6tchtYi0NbXOyHubZfZf0eb4REmujij/vAWU5oJGfb65aUQRDvax5U\nHWVib0OXPLrKQLRotr0hRG+mXGD3KZmunRZFxOqQvHfMvW9qmmeWpu0FJw9I\nyDppUbudoCPpuelr9SIKQEt5/gAuWPzIpXOMRKeeH2+kEBU5eN3AybkZIk+Q\nqOTOVCgYAdCFqev9AMwwb6ZKY9cKGYPPDUCwvZSGkFbci8LaDixQkNBGmpgh\nxtkfnhBA6BLJ+Ld/0hzsTzy+fqGr3WefZ9PilTPFTXRXaeU6noI/XDFA9mhb\nBljujyGGQFpEc1dZ9o6+IJg7JJodWEiUar8o1DCVntO2TZBmgtTwrDeVGluu\nqPhDajkHYA132ary5CVKGlX8fvAfIhmZ/LclxPIm7QMQLIfGqGpfboRacp0E\nSdaB\r\n=0pem\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDGxxWynaVqjBD2ymC+zLnzG53RC7V0CbNCGfGqoeXBQAiEAyCu363J1Yvn4dOq08mGgTarD6gO6qW5XQnCRriDeqEI="}],"size":2175,"noattachment":false,"key":"/responselike/-/responselike-2.0.0.tgz"},"maintainers":[{"name":"lukechilds","email":"lukechilds123@gmail.com"}],"_npmUser":{"name":"lukechilds","email":"lukechilds123@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/responselike_2.0.0_1570572839625_0.018801265196460415"},"_hasShrinkwrap":false,"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":1570572839825,"_cnpm_publish_time":1570572839825,"dist-tags":{"latest":"4.0.2"}}