
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
maybe-polyfill
Advanced tools
Promises for those afraid of commitment. Maybe
can be used just like Promise
.
IE8+, Chrome, Firefox, IOS 4+, Safari 5+, Opera
npm install maybe-polyfill
bower install maybe-polyfill
var mayb = new Maybe(function(resolve, reject) {
// do a thing, possibly async, then…
if (/* everything turned out fine */) {
resolve("Stuff worked!");
} else {
reject(new Error("It broke"));
}
});
// Do something when async done
maybe.then(function() {
...
});
By default maybe-polyfill uses setImmediate
, but falls back to setTimeout
for executing asynchronously. If a browser does not support setImmediate
(IE/Edge are the only browsers with setImmediate), you may see performance issues.
Use a setImmediate
polyfill to fix this issue. setAsap or setImmediate work well.
If you polyfill window.setImmediate
or use Maybe._setImmediateFn(immedateFn)
it will be used instead of window.setTimeout
npm install setasap --save
var Maybe = require('maybe-polyfill');
var setAsap = require('setasap');
Maybe._setImmediateFn(setAsap);
maybe-polyfill will warn you about possibly unhandled rejections. It will show a console warning if a Maybe is rejected, but no .catch
is used. You can turn off this behavior by setting Maybe._setUnhandledRejectionFn(<rejectError>)
.
If you would like to disable unhandled rejections. Use a noop like below.
Maybe._setUnhandledRejectionFn(function(rejectError) {});
npm install
npm test
MIT
FAQs
Promises for people afraid of commitment.
We found that maybe-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.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.