
Security News
GitHub Actions Adds cache-mode to Limit Cache Poisoning Risk
GitHub Actions now supports cache-mode, a least-privilege control on the Actions cache aimed at the cache poisoning technique behind recent compromises.
@tiny-nestjs/auto-injectable
Advanced tools
AutoInjectable is a utility library designed to simplify the usage of dependency injection in Nest. It enables seamless handling of automatic injection of dependencies by the framework. With this library, you can inject dependencies into classes without the need for module definitions.
@ComponentScan() decorator enables automatic scanning and injection of classes within a module.@AutoInjectable() decorator allows classes to be automatically injectable for DI.@AutoController() decorator automatically registers controllers.npm install @tiny-nestjs/auto-injectable
yarn add @tiny-nestjs/auto-injectable
1. @ComponentScan()
import { Module } from '@nestjs/common';
import { ComponentScan } from '@tiny-nestjs/auto-injectable';
@ComponentScan()
@Module({
imports: [],
controllers: [],
providers: [],
})
export class AppModule {
}
By applying the @ComponentScan() decorator to the AppModule class, Nest will automatically scan for classes and
inject necessary dependencies.
2. @AutoInjectable()
import { AutoInjectable } from '@tiny-nestjs/auto-injectable';
@AutoInjectable()
export class CatService {
// ...
}
In this case, by applying the @AutoInjectable() decorator to the CatService class, the class has become injectable,
allowing it to be injected into other modules without the need for module definitions.
3. @AutoController() and dependency injection
import { AutoController } from '@tiny-nestjs/auto-injectable';
@AutoController()
export class CatController {
constructor(private readonly catService: CatService) {
}
@Get('cats')
getCats() {
return this.catService.findAll();
}
}
The class with the @AutoInjectable() decorator has been successfully injected and /cats api can be accessed by
applying @AutoController() on CatController service.
| You can see actual project example here. |
|---|
To contribute to this library, fork the GitHub repository, make your changes, and create a pull request. Your contributions are highly appreciated. If you find any improvements or bugs, please open an issue.
@tiny-nestjs/auto-injectable is distributed under
the MIT license.
FAQs
Enables seamless DI within the Nest Framework.
The npm package @tiny-nestjs/auto-injectable receives a total of 6 weekly downloads. As such, @tiny-nestjs/auto-injectable popularity was classified as not popular.
We found that @tiny-nestjs/auto-injectable demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.

Security News
GitHub Actions now supports cache-mode, a least-privilege control on the Actions cache aimed at the cache poisoning technique behind recent compromises.

Company News
Allow myself to introduce... myself.

Research
/Security News
A Twitch browser extension on Chrome and Firefox forwards users’ live OAuth session tokens through proxies controlled by a Russian bot service.