A wrapper of node-fetch(https://github.com/bitinn/node-fetch) with HTTP stale controls and setting default timeout.
- Expose
stale
extensions.swr
option sets stale-while-revalidate,sie
option sets stale-if-error to Cache-Control header. Both options are set 30 sec as a default. - Set
5 sec
as a default timeout value.
npm install --save fetch-with-stale-controls
url
options
node-fetch options with additional extensions.
{
// In addition to fetch Standard and node-fetch extensions
swr: 30,
sie: 30
}