{"_id":"responselike","_rev":"199025","name":"responselike","description":"A response-like object for mocking a Node.js HTTP response stream","dist-tags":{"latest":"3.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2023-03-20T08:15:02.000Z","created":"2017-05-04T07:51:15.890Z","3.0.0":"2022-07-18T21:05:55.896Z","2.0.1":"2022-07-18T15:06:49.818Z","2.0.0":"2019-10-08T22:13:59.825Z","1.0.2":"2017-08-17T16:47:15.629Z","1.0.1":"2017-06-30T13:04:39.730Z","1.0.0":"2017-06-21T07:28:07.128Z","0.2.0":"2017-06-19T11:09:12.432Z","0.1.0":"2017-05-04T07:51:15.890Z"},"users":{},"author":{"name":"Luke Childs","email":"lukechilds123@gmail.com","url":"https://lukechilds.co.uk"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/responselike.git"},"versions":{"3.0.0":{"name":"responselike","version":"3.0.0","description":"A response-like object for mocking a Node.js HTTP response stream","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/responselike.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Luke Childs","email":"lukechilds123@gmail.com","url":"https://lukechilds.co.uk"},"type":"module","exports":"./index.js","engines":{"node":">=14.16"},"scripts":{"test":"xo && ava && tsd"},"keywords":["http","https","response","mock","test","request","responselike"],"dependencies":{"lowercase-keys":"^3.0.0"},"devDependencies":{"ava":"^4.3.1","get-stream":"^6.0.1","tsd":"^0.22.0","xo":"^0.50.0"},"types":"./index.d.ts","gitHead":"2ec61fa6535fe2a793ad32016b1f1b95d16d5e06","bugs":{"url":"https://github.com/sindresorhus/responselike/issues"},"homepage":"https://github.com/sindresorhus/responselike#readme","_id":"responselike@3.0.0","_nodeVersion":"14.19.3","_npmVersion":"8.3.2","dist":{"shasum":"20decb6c298aff0dbee1c355ca95461d42823626","size":2209,"noattachment":false,"key":"/responselike/-/responselike-3.0.0.tgz","tarball":"http://name.csiicloud.com:7001/responselike/download/responselike-3.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/responselike_3.0.0_1658178355629_0.3164521105754696"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-07-18T21:06:08.266Z","publish_time":1658178355896,"_cnpm_publish_time":1658178355896},"2.0.1":{"name":"responselike","version":"2.0.1","description":"A response-like object for mocking a Node.js HTTP response stream","funding":"https://github.com/sponsors/sindresorhus","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/sindresorhus/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":"07ece79927bb2deb6f3b9a73d6894298f664dcff","bugs":{"url":"https://github.com/sindresorhus/responselike/issues"},"homepage":"https://github.com/sindresorhus/responselike#readme","_id":"responselike@2.0.1","_nodeVersion":"14.19.3","_npmVersion":"8.3.2","dist":{"shasum":"9a0bc8fdc252f3fb1cca68b016591059ba1422bc","size":2190,"noattachment":false,"key":"/responselike/-/responselike-2.0.1.tgz","tarball":"http://name.csiicloud.com:7001/responselike/download/responselike-2.0.1.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/responselike_2.0.1_1658156809372_0.7707064851724228"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-07-18T15:14:27.269Z","publish_time":1658156809818,"_cnpm_publish_time":1658156809818},"2.0.0":{"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":{"shasum":"26391bcc3174f750f9a79eacc40a12a5c42d7723","size":2175,"noattachment":false,"key":"/responselike/-/responselike-2.0.0.tgz","tarball":"http://name.csiicloud.com:7001/responselike/download/responselike-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_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,"publish_time":1570572839825,"_cnpm_publish_time":1570572839825},"1.0.2":{"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","size":2190,"noattachment":false,"key":"/responselike/-/responselike-1.0.2.tgz","tarball":"http://name.csiicloud.com:7001/responselike/download/responselike-1.0.2.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/responselike-1.0.2.tgz_1502988434730_0.1581996688619256"},"directories":{},"publish_time":1502988435629,"_hasShrinkwrap":false,"_cnpm_publish_time":1502988435629},"1.0.1":{"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","size":3480,"noattachment":false,"key":"/responselike/-/responselike-1.0.1.tgz","tarball":"http://name.csiicloud.com:7001/responselike/download/responselike-1.0.1.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/responselike-1.0.1.tgz_1498827878831_0.5962018952704966"},"directories":{},"publish_time":1498827879730,"_hasShrinkwrap":false,"_cnpm_publish_time":1498827879730},"1.0.0":{"name":"responselike","version":"1.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.19.1","coveralls":"^2.13.1","eslint-config-xo-lukechilds":"^1.0.0","get-stream":"^3.0.0","nyc":"^10.3.2","xo":"^0.19.0"},"dependencies":{"lowercase-keys":"^1.0.0"},"gitHead":"8d5ea0b607b862239c10ea5f3af301369773107f","bugs":{"url":"https://github.com/lukechilds/responselike/issues"},"homepage":"https://github.com/lukechilds/responselike#readme","_id":"responselike@1.0.0","_npmVersion":"5.0.3","_nodeVersion":"8.0.0","_npmUser":{"name":"lukechilds","email":"lukechilds123@gmail.com"},"dist":{"shasum":"271c6b7fbe4d3efdc5a63f9b43628e59690119de","size":3470,"noattachment":false,"key":"/responselike/-/responselike-1.0.0.tgz","tarball":"http://name.csiicloud.com:7001/responselike/download/responselike-1.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/responselike-1.0.0.tgz_1498030086941_0.4431796863209456"},"directories":{},"publish_time":1498030087128,"_hasShrinkwrap":false,"_cnpm_publish_time":1498030087128},"0.2.0":{"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":{"shasum":"81b12fe4b59e4356b41c1f8db8f24dc07db0bace","size":2423,"noattachment":false,"key":"/responselike/-/responselike-0.2.0.tgz","tarball":"http://name.csiicloud.com:7001/responselike/download/responselike-0.2.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/responselike-0.2.0.tgz_1497870552306_0.4606168167665601"},"directories":{},"publish_time":1497870552432,"_hasShrinkwrap":false,"_cnpm_publish_time":1497870552432},"0.1.0":{"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","size":2425,"noattachment":false,"key":"/responselike/-/responselike-0.1.0.tgz","tarball":"http://name.csiicloud.com:7001/responselike/download/responselike-0.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/responselike-0.1.0.tgz_1493884273503_0.28556131827645004"},"directories":{},"publish_time":1493884275890,"_cnpm_publish_time":1493884275890,"_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","_attachments":{},"homepage":"https://github.com/sindresorhus/responselike#readme","bugs":{"url":"https://github.com/sindresorhus/responselike/issues"},"license":"MIT"}