
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
fetch-intercept2
Advanced tools
Interceptor library for the native fetch command inspired by angular http intercepts.
Interceptor library for the native fetch command inspired by angular http interceptors.
fetch-intercept
monkey patches the global fetch
method and allows you the usage in Browser, Node and Webworker environments.
npm install fetch-intercept2 --save
Note: You need to require fetch-intercept
before you use fetch
the first time.
Make sure you have a fetch
compatible environment or added a appropriate polyfill.
import fetchIntercept from 'fetch-intercept2';
const unregister = fetchIntercept.register({
request: function (url, config) {
// Modify the url or config here
return [url, config];
},
requestError: function (error) {
// Called when an error occured during another 'request' interceptor call
return Promise.reject(error);
},
response: function (response) {
// Modify the reponse object
return response;
},
responseError: function (error) {
// Handle an fetch error
return Promise.reject(error);
}
});
// Call fetch to see your interceptors in action.
fetch('http://google.com');
// Unregister your interceptor
unregister();
Support react-native 0.17
or higher versions.
MIT
FAQs
Interceptor library for the native fetch command inspired by angular http intercepts.
The npm package fetch-intercept2 receives a total of 1 weekly downloads. As such, fetch-intercept2 popularity was classified as not popular.
We found that fetch-intercept2 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.