
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.
Defactor allows creating deferred objects with a many-to-many relationship between queues and triggers. By creating this type of event map there shouldn't be a need for callback insanity. The idea is to create new deferreds for different call types, then return new instances. By doing this the end user's API can be fully chained. Here's an example:
// generate a new deferred object with custom event triggers and function queues
var defer = defactor()
.add( 'resolve', 'done always' )
.add( 'reject', 'fail always' )
.create();
// OR use the alternate syntax by passing an object
// (note: this will add all triggers/queues then create() when complete)
var defer = defactor({
resolve : 'done always',
reject : 'fail always'
});
// create an instance of the new deferred
var myDef = new defer(); // or just `defer()`
// queue up functions to complete
myDef.done(function( arg ) {
console.log( 'done:' + arg + ':' + this.ctx );
})
.fail(function() {
console.log( 'fail' );
})
.always(function() {
console.log( 'always' );
});
myDef.resolve( 'now', {
ctx : 'here'
}); // LOG: "done:now:here"; "always"
defactor( [clear],[map] ): initialize new defactor object. If clear === true then default behavior is to clear queue after trigger. map will accept an object of triggers : queues then create the deferred automatically.
.add( trigger, queue ): adds a new trigger/queue to the stack. queue can be a space separated string, or an array.
.create(): generates new deferred from the defactor object.
Queues can be passed context and/or an array of arguments
All generated deferreds have a promise() method that will return a promise object
Events will be cleared after triggering if true is passed when instantiating the deferred
add() can be a function, which will execute when called and pass any arguments. Example:var onEvent = defactor()
.add( 'trigger', 'debug' )
.add( 'trigger', 'ajax', function( opts ) { // make an ajax call
var ctx = this,
call = $.ajax( opts );
call.end = function() {
return ctx;
};
return call;
});
var e = new onEvent( true )
// ajax returns a new deferred context
.ajax({
// options
})
.success( fn ) // if call succeeds
.fail( fn ) // if call fails
.end() // return to previous context
.debug(function() {
// log some stuff
});
e.trigger();
FAQs
A deferred factory object
The npm package defactor receives a total of 6 weekly downloads. As such, defactor popularity was classified as not popular.
We found that defactor 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
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.