{"name":"node-mock-http","version":"1.0.2","license":"MIT","_id":"node-mock-http@1.0.2","maintainers":[{"name":"pi0","email":"pyapar@gmail.com"}],"homepage":"https://github.com/unjs/node-mock-http#readme","bugs":{"url":"https://github.com/unjs/node-mock-http/issues"},"dist":{"shasum":"e66ec4ac6a76521f0f0f438c8f9285abc691b255","tarball":"http://registry-npm.ywwl.com/node-mock-http/download/node-mock-http-1.0.2.tgz","fileCount":28,"integrity":"sha512-zWaamgDUdo9SSLw47we78+zYw/bDr5gH8pH7oRRs8V3KmBtu8GLgGIbV2p/gRPd3LWpEOpjQj7X1FOU3VFMJ8g==","signatures":[{"sig":"MEUCIQCexy9qkxcEZQO/n+WlbHHfLU7tjCOU88qusmCTnB7ZVQIgfpBXA0yrl/93i9hH48WDUArGTzLkprO+83Cuz4cSMzo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":147943,"size":38586,"noattachment":false,"key":"/node-mock-http/-/node-mock-http-1.0.2.tgz"},"type":"module","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.cjs"},"./_polyfill/buffer":{"import":{"node":"./dist/_polyfill/buffer/node.mjs","default":"./dist/_polyfill/buffer/nodeless.mjs"},"require":{"node":"./dist/_polyfill/buffer/node.cjs","default":"./dist/_polyfill/buffer/nodeless.cjs"}},"./_polyfill/events":{"import":{"node":"./dist/_polyfill/events/node.mjs","default":"./dist/_polyfill/events/nodeless.mjs"},"require":{"node":"./dist/_polyfill/events/node.cjs","default":"./dist/_polyfill/events/nodeless.cjs"}}},"gitHead":"d8b08839507b3ddecf85cbea3e32a6f7b7fd763b","scripts":{"dev":"vitest dev --coverage","lint":"eslint . && prettier -c .","test":"pnpm lint && pnpm test:types && vitest run --coverage","build":"unbuild --minify","prepack":"pnpm build","release":"pnpm test && changelogen --release && npm publish && git push --follow-tags","lint:fix":"automd && eslint . --fix && prettier -w .","test:types":"tsc --noEmit --skipLibCheck"},"_npmUser":{"name":"pi0","email":"pyapar@gmail.com"},"repository":{"url":"git+https://github.com/unjs/node-mock-http.git","type":"git"},"_npmVersion":"10.9.2","description":"<!-- automd:badges color=yellow -->","directories":{},"sideEffects":false,"_nodeVersion":"22.17.1","_hasShrinkwrap":false,"packageManager":"pnpm@10.13.1","devDependencies":{"jiti":"^2.5.1","automd":"^0.4.0","eslint":"^9.32.0","vitest":"^3.2.4","unbuild":"^3.6.0","prettier":"^3.6.2","typescript":"^5.8.3","@types/node":"^24.1.0","changelogen":"^0.6.2","eslint-config-unjs":"^0.5.0","@vitest/coverage-v8":"^3.2.4"},"_npmOperationalInternal":{"tmp":"tmp/node-mock-http_1.0.2_1753863075820_0.09618892419245362","host":"s3://npm-registry-packages-npm-production"},"readme":"# node-mock-http\n\n<!-- automd:badges color=yellow -->\n\n[![npm version](https://img.shields.io/npm/v/node-mock-http?color=yellow)](https://npmjs.com/package/node-mock-http)\n[![npm downloads](https://img.shields.io/npm/dm/node-mock-http?color=yellow)](https://npm.chart.dev/node-mock-http)\n\n<!-- /automd -->\n\nNode.js [`http.IncomingMessage`](https://nodejs.org/api/http.html#class-httpincomingmessage) and [`http.ServerResponse`](https://nodejs.org/api/http.html#class-httpserverresponse) mocked implementations that allows emulate calling Node.js http handlers. (based on [unjs/unenv v1](https://github.com/unjs/unenv/tree/v1)).\n\n## Usage\n\n> [!NOTE]\n> Documentation is incomplete!\n\n```js\nimport { fetchNodeRequestHandler } from \"node-mock-http\";\n\nconst nodeHandler = (req, res) => {\n  res.end(\"OK!\");\n};\n\nconst res = await fetchNodeRequestHandler(\n  nodeHandler,\n  \"http://example.com/test\",\n);\n```\n\n## Development\n\n<details>\n\n<summary>local development</summary>\n\n- Clone this repository\n- Install latest LTS version of [Node.js](https://nodejs.org/en/)\n- Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable`\n- Install dependencies using `pnpm install`\n- Build project in stub mode using `pnpm build --stub`\n- Run interactive tests using `pnpm dev`\n\n</details>\n\n## License\n\n<!-- automd:contributors license=MIT -->\n\nPublished under the [MIT](https://github.com/unjs/node-mock-http/blob/main/LICENSE) license.\nMade by [community](https://github.com/unjs/node-mock-http/graphs/contributors) 💛\n<br><br>\n<a href=\"https://github.com/unjs/node-mock-http/graphs/contributors\">\n<img src=\"https://contrib.rocks/image?repo=unjs/node-mock-http\" />\n</a>\n\n<!-- /automd -->\n\n<!-- automd:with-automd -->\n\n---\n\n_🤖 auto updated with [automd](https://automd.unjs.io)_\n\n<!-- /automd -->\n","publish_time":1753863076024,"_cnpm_publish_time":1753863076024,"dist-tags":{"latest":"1.0.5"}}