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.
isomorphic-fetch-reject
Advanced tools
This package is using isomorphic-fetch and extends it to reject on HTTP error.
Standard fetch does not throw on HTTP errors (>= 400 status code). This wrapper allows it to do so.
This package is perfect for apps that render on both the server and the client side.
npm i -S isomorphic-fetch-reject
yarn add isomorphic-fetch-reject
You can either use it like any other package:
import fetch from 'isomorphic-fetch-reject';
// Use just like the standard fetch
fetch('https://example.com/some/path')
.then(res => res.json())
.then(data => {
console.log(data);
})
.catch(err => {
console.error(err);
});
Or you can add the fetch function directly to the global
/window
so you can use it from anywhere:
// file1.js
import fetch from 'isomorphic-fetch-reject';
fetch.replaceGlobal();
// file2.js
// Use just like the standard fetch
fetch('https://example.com/some/path')
.then(res => res.json())
.then(data => {
console.log(data);
})
.catch(err => {
console.error(err);
});
FAQs
Isomorphic fetch that rejects on HTTP error
The npm package isomorphic-fetch-reject receives a total of 2 weekly downloads. As such, isomorphic-fetch-reject popularity was classified as not popular.
We found that isomorphic-fetch-reject 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.
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.