Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
@zeit/fetch-retry
Advanced tools
A layer on top of `fetch` (via [node-fetch](https://www.npmjs.com/package/node-fetch) with sensible defaults for retrying to prevent common errors.
A layer on top of fetch
(via node-fetch
with sensible defaults for retrying to prevent common errors.
fetch-retry
is a drop-in replacement for fetch
:
const fetch = require('@zeit/fetch-retry');
module.exports = async () => {
const res = await fetch('http://localhost:3000')
console.log(res.status);
}
Make sure to yarn add fetch-retry
in your main package.
The third optional parameter is custom retry options
passed to async-retry
.
Some errors are very common in production (like the underlying Socket
yielding ECONNRESET
), and can easily and instantly be remediated
by retrying.
The default behavior of fetch-retry
is to attempt retries 10, 50
and 250 milliseconds (a total of 3 retires) after
a network error or 5xx error occur.
The idea is to provide a sensible default: most applications should continue to perform correctly with a worst case scenario of a given request having an additional 250ms overhead.
On the other hand, most applications that use fetch-retry
instead of
vanilla fetch
should see lower rates of common errors and fewer 'glitches'
in production.
To run rests, execute
npm test
FAQs
A layer on top of `fetch` (via [node-fetch](https://www.npmjs.com/package/node-fetch)) with sensible defaults for retrying to prevent common errors.
We found that @zeit/fetch-retry demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 57 open source maintainers 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
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.