
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.
@microservice/koa-inject
Advanced tools
minimalist dependency injection for koa applications
app = koa(), app.use(inject(function* | object))
var inject = require('@microservice/koa-inject');
app = koa();
// pass an object in to define provider functions
app.use(inject({
// the dependency 'foo' will be the return value of the function
foo: function() {
console.log(this); // the koa context
return 'foo!';
},
// providers are co.wrap'd so they can return promises, etc.
bar: function() {
return Promise.resolve('bar!');
}
}));
// dependency consumer functions are normal middleware
// ... but with extra injected arguments!
app.use(inject(function* (next, foo) {
console.log(foo); // 'foo!';
yield* next;
}));
// they can also be middleware
app.use(inject({
// but they need to set this[key] correctly before yielding
baz: function* (next) {
this.biff = 'bad'; // NO!
this.baz = 'good'; // ok
yield* next;
},
// and dependency consumers, too!
blah: function* (next, baz) {
this.blah = 'blah...' + baz;
yield* next;
}
}));
providers in a definition object are (automagically) run in order, depending on their dependencies.
FAQs
simple dependency injection for koa
The npm package @microservice/koa-inject receives a total of 93 weekly downloads. As such, @microservice/koa-inject popularity was classified as not popular.
We found that @microservice/koa-inject 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.