{"name":"node-mock-http","version":"1.0.3","license":"MIT","_id":"node-mock-http@1.0.3","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":"4e55e093267a3b910cded7354389ce2d02c89e77","tarball":"http://registry-npm.ywwl.com/node-mock-http/download/node-mock-http-1.0.3.tgz","fileCount":28,"integrity":"sha512-jN8dK25fsfnMrVsEhluUTPkBFY+6ybu7jSB1n+ri/vOGjJxU8J9CZhpSGkHXSkFjtUhbmoncG/YG9ta5Ludqog==","signatures":[{"sig":"MEYCIQCPWp/RpNpv4D1bNGdwsGc8/gYvXEDKZDBk43AsjA+NFgIhAO3fsQdooyrIsdb4tyCgwO1dpWSekWqui8ab/1u4SlKy","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":148191,"size":38579,"noattachment":false,"key":"/node-mock-http/-/node-mock-http-1.0.3.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":"202ca83060b366c4d35c3e6f378d9e56a2e7264f","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.14.0","_hasShrinkwrap":false,"packageManager":"pnpm@10.15.1","devDependencies":{"jiti":"^2.5.1","automd":"^0.4.0","eslint":"^9.34.0","vitest":"^3.2.4","unbuild":"^3.6.1","prettier":"^3.6.2","typescript":"^5.9.2","@types/node":"^24.3.1","changelogen":"^0.6.2","eslint-config-unjs":"^0.5.0","@vitest/coverage-v8":"^3.2.4"},"_npmOperationalInternal":{"tmp":"tmp/node-mock-http_1.0.3_1756981811693_0.9110503687879998","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":1756981811889,"_cnpm_publish_time":1756981811889,"dist-tags":{"latest":"1.0.5"}}