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.
containerr.js
Advanced tools
This library include a simple container for manage dependency injection
/**
* Check if the dependence is in the container
*
* @param key
* @returns {boolean}
* @throws Error: The key must be a string
*/
has(key);
/**
* Get dependence
*
* @param key
* @returns {boolean}
* @throws Error: The key must be a string
* @throws Error: $key is not in the container
*/
get(key);
/**
* Load dependence
*
* @param key
* @param object
* @returns {boolean}
* @throws Error: The key must be a string
* @throws Error: $key is already in the container
*/
share(key, object);
const { Containerr } = require('./containerr');
let container = new Containerr();
let dependence = {
name: 'dependence1'
};
let key = 'dependence1';
let key2 = 'dependence2';
let key3 = 'dependence2';
container.has(key); //false
container.share(key, dependence); //true
container.share(key2, () => {
return { obj: 'obj' };
}); //true
container.has(key); //true
container.get(key); //return dependence variable
container.get(key2); //return dependence variable
container.share(key, dependence); //Exception = Error: key is already in the container
container.get(key3); //Exception = Error: key is not in the container
FAQs
A simple container for manage dependency injection.
The npm package containerr.js receives a total of 0 weekly downloads. As such, containerr.js popularity was classified as not popular.
We found that containerr.js 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.