
Security News
The Code You Didn't Write Is Still Yours to Defend
AI agents are pulling packages into environments no scanner is watching, creating exposure before security teams can see it.
auto-injectable-test
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.
@AutoInjectable() decorator allows classes to be automatically injectable for DI.@ComponentScan() decorator enables automatic scanning and injection of classes within a module.npm install @tiny-nestjs/auto-injectable
1. @ComponentScan()
Use @ComponentScan() decorator to enable automatic scanning and injection of classes within a module:
```
import { Module } from '@nestjs/common';
import { AppService } from './app.service';
import { AppController } from './app.controller';
import { ComponentScan } from '@nestjs/auto-injectable';
@ComponentScan()
@Module({
imports: [],
controllers: [AppController],
providers: [AppService],
})
export class AppModule {}
```
By applying the @ComponentScan() decorator to the AppModule class, Nest will automatically scan for classes and
inject necessary dependencies.
2. @AutoInjectable()
Use @AutoInjectable() decorator to make a class injectable for DI:
```
import { AutoInjectable } from '@nestjs/auto-injectable';
@AutoInjectable()
export class CatService {
// ...
}
```
On this case, by applying @AutoInjectable() decorator to the CatService class, the class can now be
automatically injected into other modules.
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.
We found that auto-injectable-test 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
AI agents are pulling packages into environments no scanner is watching, creating exposure before security teams can see it.

Security News
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.