Nocturnally Psychologizing Millipede

npm

npm’s 2019 JavaScript ecosystem survey analysis is now available!Get your copy here »

timeout-request

1.8.0 • Public • Published

timeout-request

NPM version Linux Status Windows Status Dependency Status Coveralls

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-request

or

git clone git://github.com/hex7c0/timeout-request.git

API

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, check res._header before callback (default "false")
  • data - Object Object passed to custom callback after req and res (default "null")
  • callback - Function Custom callback instead of res.end (default "null")

Examples

Take a look at my examples

License Apache2

install

npm i timeout-request

Downloadsweekly downloads

35

version

1.8.0

license

Apache-2.0

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability