Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
@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,883 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.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.