
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
defer-calls
Advanced tools
Defer calls to an object's method, then executes them all when you give the signal
Defer calls to an object's method, then executes them all when you give the signal
npm i defer-calls
var deferMethod = require('defer-calls').method;
var guy = {
sayHello: function(name) {
return 'Hello ' + name;
}
};
guy.sayHello('you'); // => 'Hello you'
var helloWaiting = deferMethod(guy, 'sayHello', function (name) {
return 'Wait ' + name;
});
// The 3rd arg is the temporary behavior, if you just want to return a value,
// you can pass this value instead of a function.
// Hold it...
guy.sayHello('world'); // => 'Wait world'
guy.sayHello('everyone'); // => 'Wait everyone'
helloWaiting.callsList; // => [['world'], ['everyone']];
// WARNING : ['world'] and ['everyone'] are "arguments arrays" i.e. not real Arrays
// See here : https://developer.mozilla.org/docs/Web/JavaScript/Reference/Fonctions/arguments
// Then give the signal!
helloWaiting.execAll() // => ['Hello world', 'Hello everyone']
// After that...
helloWaiting.execAll(); // Noop
helloWaiting.callsList; // []
// Everything is back to normal
guy.sayHello('Kitty'); // => 'Hello Kitty'
Equivalent for a function instead of a method.
MIT
FAQs
Defer calls to an object's method, then executes them all when you give the signal
The npm package defer-calls receives a total of 0 weekly downloads. As such, defer-calls popularity was classified as not popular.
We found that defer-calls 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.