Gathering detailed insights and metrics for @nestjsx/api-version
Gathering detailed insights and metrics for @nestjsx/api-version
Gathering detailed insights and metrics for @nestjsx/api-version
Gathering detailed insights and metrics for @nestjsx/api-version
npm install @nestjsx/api-version
Typescript
Module System
Node Version
NPM Version
TypeScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
34 Stars
2 Commits
1 Forks
1 Branches
1 Contributors
Updated on Dec 30, 2023
Latest Version
0.1.1
Package Id
@nestjsx/api-version@0.1.1
Unpacked Size
7.26 kB
Size
3.35 kB
File Count
12
NPM Version
5.6.0
Node Version
9.11.1
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
@nestjsx/api-verion
has been designed to quickly help you with the access logic if you're using global prefix
in your application and want to restrict an access to different API endpoints with different API versions. For now it works with Express
and Fastify
adapters.
1npm i @nestjsx/api-version --save
global prefix
in your bootstrap file1import { NestFactory } from '@nestjs/core'; 2import { ApplicationModule } from './app.module'; 3 4async function bootstrap() { 5 const app = await NestFactory.create(ApplicationModule); 6 app.setGlobalPrefix('v1'); // <-- here 7 await app.listen(3000); 8} 9bootstrap();
ApiVersionGuard
in app module1import { ApiVersionGuard } from '@nestjsx/api-version'; 2import { Module } from '@nestjs/common'; 3import { APP_GUARD } from '@nestjs/core'; 4 5@Module({ 6 providers: [ 7 { 8 provide: APP_GUARD, 9 useClass: ApiVersionGuard, 10 }, 11 ], 12}) 13export class ApplicationModule {}
ApiVersion
decorator in your controller1import { ApiVersion } from '@nestjsx/api-version'; 2import { Controller, Get } from '@nestjs/common'; 3 4@Controller('cats') 5export class CatsController { 6 @Get() 7 @ApiVersion() 8 findAllV1() { 9 return 'This action will work in all versions'; 10 } 11 12 @Get() 13 @ApiVersion('v1') 14 findAllV1() { 15 return 'This action will work in v1 version'; 16 } 17 18 @Get() 19 @ApiVersion('v2') 20 findAllNext() { 21 return 'This action will work in v2 version only'; 22 } 23}
1npm run test:e2e
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/2 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
no SAST tool detected
Details
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
89 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More