Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
fetch-jsonp-polyfill
Advanced tools
JSONP is NOT supported in standard Fetch API.If you are sleepy for such a problem, please use this Polyfill.
You can install with npm.
npm install fetch-jsonp-polyfill --save-dev
He can be compatible with almost all current jsonp polyfills, includinghttps://github.com/github/fetch https://github.com/matthew-andrews/isomorphic-fetch https://github.com/bitinn/node-fetch and many more.
Please note that they must be imported after them.
require('isomorphic-fetch');
require('fetch-jsonp-polyfill');
You don't need to make any changes, just modify the method:'GET'
to method:'JSONP'
.
In this way, I didn't modify any native code.
var URL = 'http://jsfiddle.net/echo/jsonp/';
fetch(URL, {
method: "JSONP"
})
.then(res => res.json())
.then(data => {
console.log(data);
})
.catch(err => {
console.log(err);
});
fetch(URL, {
method: 'JSONP',
timeout: 5000,
callback: 'callback',
callbackName: 'fetchjsonp_callback',
})
Latest ✔ | Latest ✔ | 9+ ✔ | Latest ✔ | 6.1+ ✔ |
MIT
FAQs
a jsonp fetch polyfill
The npm package fetch-jsonp-polyfill receives a total of 30 weekly downloads. As such, fetch-jsonp-polyfill popularity was classified as not popular.
We found that fetch-jsonp-polyfill 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.