
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@crowdlinker/nestjs-commons
Advanced tools
Commons for NestJS
npm install --save @crowdlinker/nestjs-commons
// or
// yarn add @crowdlinker/nestjs-commons
import dayjs from 'dayjs';
import { DATE_FORMAT } from '@crowdlinker/nestjs-commons/constants/date';
new days().format(DATE_FORMAT); // 2021-05-21
Helpers are common functions used throughout the codebase for performing some basic operations.
import { isLeapYear } from '@crowdlinker/nestjs-commons/helpers/date';
if (isLeapYear()) {
// const noOfDays = 366;
} else {
// const noOfDays = 365;
}
To know about what an HttpExceptionFilter is, please read the NestJS documentation.
import { Module } from '@nestjs/common';
import { APP_FILTER } from '@nestjs/core';
import { AppService } from './app.service';
import { AppController } from './app.controller';
import { AppConfigService } from './config/app/config.service';
import { HttpExceptionFilter } from '@crowdlinker/nestjs-commons/exceptions/filters/http-exception';
@Module({
imports: [
// ...
],
controllers: [AppController],
providers: [
AppService,
{
provide: APP_FILTER,
useFactory: async (appConfigService: AppConfigService) => {
return new HttpExceptionFilter(appConfigService);
},
},
],
})
export class AppModule {}
Note: AppConfigService should implement AppConfigServiceInterface provided in `@crowdlinker/nestjs-commons/interfaces/config.interface. See example below:
import { Injectable } from '@nestjs/common';
import { AppConfig } from './config.interface';
import { ConfigService } from '@nestjs/config';
import { AppConfigServiceInterface } from '@crowdlinker/nestjs-commons/interfaces/config';
@Injectable()
export class AppConfigService implements AppConfigServiceInterface {
// ....
}
FAQs
Commons for NestJS based projects
The npm package @crowdlinker/nestjs-commons receives a total of 14 weekly downloads. As such, @crowdlinker/nestjs-commons popularity was classified as not popular.
We found that @crowdlinker/nestjs-commons demonstrated a healthy version release cadence and project activity because the last version was released less than 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.