
Research
/Security News
Mini Shai-Hulud Campaign Hits Red Hat Cloud Services npm Packages
A mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.
di-ts-decorators
Advanced tools
install: npm install di-ts-decorators
Singleton:
import { Singleton, Inject } from "di-ts-decorators";
class SingletonClassFN1 {}
class SingletonClassFN2 {}
class SingletonClassFN3 {}
Singleton("config", {key: "value"});
Singleton(SingletonClassFN1);
Singleton("FN2", SingletonClassFN2);
Singleton(SingletonClassFN3, new SingletonClassFN3());
@Singleton()
class SingletonClassDE1 {}
@Singleton("DE2")
class SingletonClassDE2 {}
class B {
constructor (
private readonly _config = Inject("config"),
private readonly _SingletonClassFN1 = Inject(SingletonClassFN1),
private readonly _SingletonClassFN2 = Inject("FN2"),
private readonly _SingletonClassFN1 = Inject(SingletonClassFN3),
private readonly _SingletonClassDE1 = Inject(SingletonClassDE1),
private readonly _SingletonClassDE2 = Inject("DE2")
) {}
}
const b = new B();
Factory:
import { Factory, Catalog } from "di-ts-decorators";
class FactoryClassFN1 {}
class FactoryClassFN2 {}
Factory(FactoryClassFN1);
Factory("FN2", FactoryClassFN2);
@Factory()
class FactoryClassDE1 {}
@Factory("DE2")
class FactoryClassDE2 {}
class B {
constructor (
private readonly _FactoryClassFN1 = Catalog(FactoryClassFN1)
private readonly _FactoryClassFN2 = Catalog("FN2")
private readonly _FactoryClassDE1 = Catalog(FactoryClassDE1)
private readonly _FactoryClassDE2 = Catalog("DE2")
) {}
}
const b = new B();
FAQs
simple dependency injection
We found that di-ts-decorators 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 mini Shai-Hulud campaign compromised Red Hat Cloud Services npm packages to steal developer and CI/CD secrets during installation.

Research
/Security News
The North Korean malware loader hides in a Packagist-listed package and its GitHub branch to fetch and execute remote code in a likely Contagious Interview-style lure.

Security News
The Rust project is moving toward formal rules on LLM use in contributions after months of internal debate over maintainer burden, code quality, and contributor experience.