timeout-request
v1.8.0
Published
http timeout request middleware
Downloads
63
Readme
timeout-request
Set the number of milliseconds that a script is allowed to run in nodejs.
If this timeout is reached, res.end() or custom callback will be called
Installation
Install through NPM
npm install timeout-requestor
git clone git://github.com/hex7c0/timeout-request.gitAPI
inside expressjs project
var timeout = require('timeout-request');
var app = require('express')();
app.use(timeout());timeout(options)
options
milliseconds- Number Number of milliseconds before callback (default "5000")header- Boolean If enabled, checkres._headerbefore callback (default "false")data- Object Object passed to custom callback afterreqandres(default "null")callback- Function Custom callback instead ofres.end(default "null")
Examples
Take a look at my examples
