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.
deferred-bounce
Advanced tools
Deferred call reject function by timeout if resolve function was not called.
Call reject-function after expiration of timeout if resolve-function was not called.
npm i --save deferred-bounce
deferredBound(resolveFunction, rejectFunction, scope, delay);
var db = require('deferred-bounce');
var resolve = function(err, response) {
if (err) return;
console.log(response);
};
var reject = function() {
console.log('no 2 seconds response');
};
var deferred = db(resolve, reject, this, 2000);
anyAsyncFunction(deferred);
resolveFunction
- function which will be called if deferred instance will calledrejectFunction
- function which will be called after expiration of delay and if deferred instance will not calledscope
- (optional) - bind scope to resolve and reject functionsdelay
- timeout var db = require('deferred-bounce');
var resolve = function() {
console.log('resolve');
};
var reject = function() {
console.log('no 2 seconds response');
};
var deferred = db(resolve, reject, this, 2000);
deferred();
// will call resolve function. reject function will not be called ever
var db = require('deferred-bounce');
var resolve = function() {
console.log('resolve');
};
var reject = function() {
console.log('no 2 seconds response');
};
var deferred = db(resolve, reject, this, 2000);
setTimout(function() {
deferred();
}, 3000);
// reject function will be called. resolve will not be called ever
WTFPL © Dmitry Pavlovsky
FAQs
Deferred call reject function by timeout if resolve function was not called.
The npm package deferred-bounce receives a total of 0 weekly downloads. As such, deferred-bounce popularity was classified as not popular.
We found that deferred-bounce 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.