{"name":"responselike","version":"4.0.2","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","type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=20"},"scripts":{"test":"xo && ava && tsd"},"keywords":["http","https","response","mock","test","request","responselike"],"dependencies":{"lowercase-keys":"^3.0.0"},"devDependencies":{"@types/node":"^24.7.1","ava":"^6.4.1","decompress-response":"^9.0.0","get-stream":"^9.0.1","tsd":"^0.33.0","xo":"^1.2.3"},"xo":{"rules":{"@typescript-eslint/no-restricted-types":"off"}},"gitHead":"e0739da83ed0c86b658e85a94e8e5ce50d145d8a","types":"./index.d.ts","_id":"responselike@4.0.2","bugs":{"url":"https://github.com/sindresorhus/responselike/issues"},"homepage":"https://github.com/sindresorhus/responselike#readme","_nodeVersion":"20.19.5","_npmVersion":"11.6.1","dist":{"integrity":"sha512-cGk8IbWEAnaCpdAt1BHzJ3Ahz5ewDJa0KseTsE3qIRMJ3C698W8psM7byCeWVpd/Ha7FUYzuRVzXoKoM6nRUbA==","shasum":"d99a1105aeca5909c1e93156a839c7f3173e26c2","tarball":"http://registry-npm.ywwl.com/responselike/download/responselike-4.0.2.tgz","fileCount":5,"unpackedSize":6104,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCID7OfOrDnJXv7JvrrgLkGxhdpdHanIQ73ZfwyfZgwbhyAiEAzZOCKstdTpqgLLm+LmEmT/x2/wD+7FfYNk9Mh6Q0044="}],"size":2514,"noattachment":false,"key":"/responselike/-/responselike-4.0.2.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/responselike_4.0.2_1760084021158_0.10718217476989222"},"_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":1760084021343,"_cnpm_publish_time":1760084021343,"dist-tags":{"latest":"4.0.2"}}