
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
@zcodeapp/di
Advanced tools
This module provides a lightweight and efficient implementation of dependency injection (DI) in TypeScript. It consists of three main components: Di (Dependency Injection container), Inject (decorator for dependency injection), and Injectable (decorator to mark a class as available for injection).
Include the Di class in your TypeScript project:
npm install @zcodeapp/di
First, import the Di class and other necessary interfaces:
import { Di } from "@zcodeapp/di";
import { Example } from "example"
const di = Di.getInstance();
di.register(Example);
const instance = di.get(Example);
Di
The core of the DI system, responsible for creating and managing instances.
Inject
A decorator used to inject dependencies into a class.
Injectable
A decorator that marks a class as injectable, allowing it to be managed by the Di container.
Here's a basic example of how to use the DI module:
import { Di, Injectable, Inject } from "@zcodeapp/di";
@Injectable()
class DependencyClass {}
@Injectable()
class ConsumerClass {
constructor(private dependency: DependencyClass) {}
}
const di = Di.getInstance();
const instance = di.get(ConsumerClass);
This project is licensed under the MIT License - see the LICENSE file for details.
FAQs
Dependency Injection
The npm package @zcodeapp/di receives a total of 0 weekly downloads. As such, @zcodeapp/di popularity was classified as not popular.
We found that @zcodeapp/di demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers 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
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.