{"name":"node-mock-http","version":"0.1.2","license":"MIT","_id":"node-mock-http@0.1.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":"702a27ba5e8935262c36e778b7ce274cd07495de","tarball":"http://registry-npm.ywwl.com/node-mock-http/download/node-mock-http-0.1.2.tgz","fileCount":28,"integrity":"sha512-G7KCCUZ/aYzwwyDwPH5mESs18ijVJaktSNg1MVcYFAOHw3PTHh1O8S7c4ioWRXVdz7NniKAY5nM6359pAPYfwQ==","signatures":[{"sig":"MEQCIHeQkOgRSODx+2JunjtoURYI8JzUuCwQHFiCA5NnJoSLAiAXtlMmKNdcCuhJREe6s94cDR7IpZdAMVYzYwSGYCbbMg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":194586,"size":39748,"noattachment":false,"key":"/node-mock-http/-/node-mock-http-0.1.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":"54db6aa4293abc6538c4e8ce2cd5964876abd740","scripts":{"dev":"vitest dev --coverage","lint":"eslint . && prettier -c .","test":"pnpm lint && pnpm test:types && vitest run --coverage","build":"unbuild","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.13.0","_hasShrinkwrap":false,"packageManager":"pnpm@10.2.0","devDependencies":{"jiti":"^2.4.2","automd":"^0.3.12","eslint":"^9.19.0","vitest":"^3.0.4","unbuild":"^3.3.1","prettier":"^3.4.2","typescript":"^5.7.3","@types/node":"^22.12.0","changelogen":"^0.5.7","eslint-config-unjs":"^0.4.2","@vitest/coverage-v8":"^3.0.4"},"_npmOperationalInternal":{"tmp":"tmp/node-mock-http_0.1.2_1738783135284_0.47387005540577865","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":1738783135486,"_cnpm_publish_time":1738783135486,"dist-tags":{"latest":"1.0.5"}}