Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
dependency-injection-cat
Advanced tools
Dependency Injection Cat is a TypeScript-only library which allows you to implement the Dependency Inversion pattern with Dependency Injection
Dependency Injection Cat is a TypeScript-only library which allows you to implement the Dependency Inversion pattern with Dependency Injection
Install with yarn
yarn add dependency-injection-cat
Install with npm
npm install dependency-injection-cat
Simple case
// requesters.diconfig.ts
import { Bean, Qualifier } from 'dependency-injection-cat';
import { IRequester } from '../IRequester';
import { Requester } from '../Requester';
import { ILogger } from '../ILogger';
export class Requesters {
@Bean
requester(logger: ILogger): IRequester {
return new Requester(logger);
}
//or
requester = Bean<IRequester>(Requester);
}
// loggers.diconfig.ts
import { Bean } from 'dependency-injection-cat';
import { ILogger } from '../ILogger';
import { Logger } from '../Logger';
export class Loggers {
@Bean
logger(): ILogger {
return new Logger();
}
//or
@Bean
logger = Bean<ILogger>(Logger);
}
// main.ts
import { container } from 'dependency-injection-cat';
import { IRequester } from './IRequester';
const requester = container.get<IRequester>();
requester.makeRequest....
This project is under the MIT License
FAQs
DI Cat is a truly clean DI-container, which allows you not to pollute your business logic with decorators from DI/IOC libraries!
The npm package dependency-injection-cat receives a total of 29 weekly downloads. As such, dependency-injection-cat popularity was classified as not popular.
We found that dependency-injection-cat 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
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.