Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
boxed-injector
Advanced tools
Dependency Injection Tools
$ npm install --save boxed-injector
This is a set of lightweight Dependency Injection components that can be used in both client and server javascript code.
There are 4 components.
$ npm install --save boxed-injector
'use strict';
const parts = [];
class EngineFactory {
static get inject() {
return [
'Parts'
];
}
constructor(parts) {
this.parts = parts;
}
}
class CarFactory {
static get inject() {
return [
'EngineFactory'
];
}
constructor(engineFactory) {
this.engineFactory = engineFactory;
}
}
// Dependency Injection Container
const Injector = require('boxed-injector').Injector;
let injector = new Injector();
// Register instances
injector.register('Parts', parts);
// Register Factories
injector
.factory('EngineFactory', EngineFactory)
.factory('CarFactory', CarFactory);
const carFactory = injector.get('CarFactory');
console.log(carFactory);
// Service Locator - warning - this is a singleton!
const Locator = require('boxed-injector').Locator;
Locator.set(injector);
injector = Locator.get();
const sameCarFactory = injector.get('CarFactory');
console.log(sameCarFactory);
console.log(carFactory === sameCarFactory);
// injector.get('whatever');
We look forward to seeing your contributions!
MIT © Ben Lugavere
FAQs
Dependency Injection Tools
The npm package boxed-injector receives a total of 41 weekly downloads. As such, boxed-injector popularity was classified as not popular.
We found that boxed-injector 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.