Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
fetch-fetch-fetch
Advanced tools
Wraps netive fetch and allows for specifying timeout and retry.
The Fetch API is a api that provides for interacting with network resources in a asynchronous manner. As of this writing, the native implementation is well supported in all browsers except IE. For full legacy support it is best to use a polyfill, such as whatwg-fetch.
This project wraps whatever version of the Fetch API you've chosen to use (native or polyfilled), and adds mechanisms that allow for specifying timeout length and retries.
Import the wrapper function:
import 'fetchFetchFetch' from 'fetch-fetch-fetch';
The first two parameters to the function are just the standard Fetch API parameters, consisting of the url and the init parameters, usage here.
A timeout length can be passed in milliseconds to the wrapper api. If a response is not received within the specified time period, the call is considered failed and an Error is thrown.
fetchFetchFetch('/my/data', undefined, 5000, undefined)
.then(response => { console.log(response); })
.catch(error => { console.log('Call failed'); });
The wrapper api allows for specifying the number of times that the call should be tried. Retries will occur only if the call times out. A failure response from the service is considered a valid response and will be returned as normal.
fetchFetchFetch('/my/data', undefined, 5000, 2)
.then(response => { console.log(response); });
FAQs
Wraps netive fetch and allows for specifying timeout and retry.
The npm package fetch-fetch-fetch receives a total of 7 weekly downloads. As such, fetch-fetch-fetch popularity was classified as not popular.
We found that fetch-fetch-fetch demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.