LookAtMySuitBot/js/node_modules/timed-out
Brett 5f2b208d42 c++ setup 2023-12-24 20:08:39 -05:00
..
index.js c++ setup 2023-12-24 20:08:39 -05:00
package.json c++ setup 2023-12-24 20:08:39 -05:00
readme.md c++ setup 2023-12-24 20:08:39 -05:00

readme.md

timed-out Build Status

Timeout HTTP/HTTPS requests

Emit Error object with code property equal ETIMEDOUT or ESOCKETTIMEDOUT when ClientRequest is hanged.

Usage

var get = require('http').get;
var timeout = require('timed-out');

var req = get('http://www.google.ru');
timeout(req, 2000); // Set 2 seconds limit

API

timedout(request, time)

request

Required
Type: ClientRequest

The request to watch on.

time

Required
Type: number

Time in milliseconds before errors will be emitted and request.abort() call happens.

License

MIT © Vsevolod Strukchinsky