Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
fetch-enhanced
Advanced tools
Readme
fetch-enhanced
wraps a provided fetch
-like function like undici or node-fetch and adds:
import {fetch as undiciFetch} from "undici";
import fetchEnhanced from "fetch-enhanced";
const fetch = fetchEnhanced(undiciFetch, {undici: true});
await fetch("https://example.com");
fetch
-like module that takes (url, opts)
and a agent
(like node-fetch
) or dispatcher
(like undici
) option.opts
Object Required.
agentCacheSize
: number Size of the agent cache. Default: 512
.undici
: boolean Whether the fetch implementation is undici. Required.Returns: A wrapped fetch
function.
opts
Object
timeout
: number Request timeout in milliseconds. Default: 0 (meaning no timeout).noProxy
: boolean Explicitely disable any proxy server use. Default: false.agent
: http.Agent Custom HTTP agent. When specified, proxy discovery will no longer work.agentOpts
: object Agent or Dispatcher options.Default: {maxSockets: 64, keepAlive: false}
agentOpts.noProxy
: boolean Do not use proxy in any case. Default: false
.fetch
module option, like for node-fetch
Error class that can be used for err instanceof TimeoutError
:
import {TimeoutError} from "fetch-enhanced";
try {
await fetch("https://example.com", {timeout: 0});
} catch (err) {
console.log(err instanceof TimeoutError);
// => true
}
Clear the agent cache and destroys all cached agents. This is generally only neccessary when the proxy environment variables are expected to change during runtime.
process.env.HTTPS_PROXY = "https://proxy1.dev";
await fetch("https://example.com");
fetch.clearCache();
process.env.HTTPS_PROXY = "https://proxy2.dev";
await fetch("https://example.com");
© silverwind, distributed under BSD licence
FAQs
fetch wrapper with support for automatic HTTP proxy, timeout and accessible agent options
The npm package fetch-enhanced receives a total of 852 weekly downloads. As such, fetch-enhanced popularity was classified as not popular.
We found that fetch-enhanced demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.