timelimit
v1.0.1
Published
Reject promises on timeout
Downloads
4
Maintainers
Readme
timelimit
Reject promises on timeout.
Installation
npm install --save timelimit
Usage
Basic usage:
import timelimit from 'timelimit'
const req = timelimit(
fetch('https://example.com'),
10000, // 10 seconds
{
rejectOnTimeout: true, // default is true
errorMessage: 'timeout', // timeout error message (thrown if rejectOnTimeout is true)
},
)