{"name":"timed-out","version":"7.0.0","description":"Timeout HTTP/HTTPS requests","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/timed-out.git"},"funding":"https://github.com/sponsors/sindresorhus","type":"module","exports":"./index.js","sideEffects":false,"engines":{"node":">=20"},"scripts":{"test":"xo && node --test"},"keywords":["http","https","timeout","get","url","uri","request","simple"],"devDependencies":{"xo":"^1.2.2"},"_id":"timed-out@7.0.0","gitHead":"d4d40e5661f1b4083cd70a2d7d42c4e2ab90f5bd","bugs":{"url":"https://github.com/sindresorhus/timed-out/issues"},"homepage":"https://github.com/sindresorhus/timed-out#readme","_nodeVersion":"20.19.1","_npmVersion":"10.9.2","dist":{"integrity":"sha512-OHL5R/WYuj8HiO55CKvfjAP1g5b6hAwcF2PTiJyCUhvkmvbD91WwBrpDrHHmfFus1pFcq5A63P9Z29lqTbfWQw==","shasum":"833d515cee7bc740d2d467e89b72ac2f7e28274d","tarball":"http://registry-npm.ywwl.com/timed-out/download/timed-out-7.0.0.tgz","fileCount":4,"unpackedSize":4080,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIG6q9NhHeox4t4G/Emmr9sa9t/VhEcCaIUTVwypHuFfUAiEAgyL8MDaApog/siODdGBbjs9lXg6ch5/AXMALKAT9ohY="}],"size":2089,"noattachment":false,"key":"/timed-out/-/timed-out-7.0.0.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/timed-out_7.0.0_1757450248025_0.16424459348011156"},"_hasShrinkwrap":false,"readme":"# timed-out\n\n> Timeout HTTP/HTTPS requests\n\nEmits Error object with `code` property equal `ETIMEDOUT` or `ESOCKETTIMEDOUT` when `ClientRequest` is hanged.\n\n## Usage\n\n```js\nimport http from 'node:http';\nimport timedOut from 'timed-out';\n\nconst request = http.get('http://www.google.ru');\ntimedOut(request, 2000); // Sets a 2 seconds limit\n```\n\n## API\n\n### timedout(request, time)\n\n#### request\n\n*Required*\nType: [`ClientRequest`](https://nodejs.org/api/http.html#http_class_http_clientrequest)\n\nThe request to watch.\n\n#### time\n\n*Required*\nType: `number | object`\n\nTime in milliseconds to wait for a `connect` event on the socket and also time to wait on inactive socket.\n\nOr you can pass an object with the following fields:\n\n- `connect` - Time to wait for a connection.\n- `socket`  - Time to wait for activity on the socket.\n","publish_time":1757450248193,"_cnpm_publish_time":1757450248193,"dist-tags":{"latest":"7.0.0"}}