Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@osskit/fetch-enhancers
Advanced tools
A collection of composable enhancers on top of standard js fetch api. Does not include a fetch implementation, you need to bring your owm.
A collection of composable enhancers on top of standard js fetch api. Does not include a fetch implementation, you need to bring your owm.
yarn add @osskit/fetch-enhancers
import fetch from 'node-fetch'
import {withTimeout,withRetry} from '@osskit/fetch-enhancers'
const fetchWithTimeout = withTimeout(fetch, {
timeout: {
requestTimeoutMs: 5000
}
}); // *optional* global options 5 seconds timeout
await fetchWithTimeout('http://slow.com/get',{
enhancers:{
timeout:{
requestTimeoutMs: 1000
}
}
}) // *optional* per call options 1 second timeout
const fetchWithRetry = withRetry(fetch,{
retry:{
minTimeout: 1000, //In MS
retries: 3,
factor: 5
}
}); // *optional* global options (retry is async-retry's options object)
await fetchWithRetry('https://flakey.com/get,{
retry:{
minTimeout: 1000, //In MS
retries: 10,
factor: 2
}
}); // *optional* per call options (retry is async-retry's options object)
// compose enhancers
const fetchWithRetryAndTimeout = withRetry(
withTimeout(fetch, {
timeout: {
requestTimeoutMs: 5000
}
}),
{
retry: {
minTimeout: 1000, //In MS
retries: 3,
factor: 5
}
}
);
const fetchWithRetryAndTimeout = withRetry(withTimeout(fetch)); // no global options
// per call options when composing enhancers
await fetchWithRetryAndTimeout('https://slow-and-flakey/get',{
enhancers:{
retry:{
minTimeout: 1000, //In MS
retries: 3,
factor: 5
},
timeout:{
requestTimeoutMs: 5000
}
}
})
FAQs
Unknown package
The npm package @osskit/fetch-enhancers receives a total of 7,553 weekly downloads. As such, @osskit/fetch-enhancers popularity was classified as popular.
We found that @osskit/fetch-enhancers demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.