{"id":29601353,"url":"https://github.com/crowdlinker/nestjs-commons","last_synced_at":"2025-07-20T13:02:11.412Z","repository":{"id":42236383,"uuid":"377964386","full_name":"CrowdLinker/nestjs-commons","owner":"CrowdLinker","description":"NestJS Commons used in many projects.","archived":false,"fork":false,"pushed_at":"2025-05-14T16:22:26.000Z","size":164,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-07-18T03:57:21.097Z","etag":null,"topics":["constants","dayjs","functions","helpers","middlewares","nestjs","nodejs","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CrowdLinker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-06-17T21:26:38.000Z","updated_at":"2025-05-14T16:22:02.000Z","dependencies_parsed_at":"2024-09-13T09:19:35.484Z","dependency_job_id":"bcd5558e-941a-4b04-af09-9b01ddaba761","html_url":"https://github.com/CrowdLinker/nestjs-commons","commit_stats":{"total_commits":17,"total_committers":3,"mean_commits":5.666666666666667,"dds":0.2941176470588235,"last_synced_commit":"953e79bae5d6102114eb13463c5a69604ef63b09"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/CrowdLinker/nestjs-commons","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrowdLinker%2Fnestjs-commons","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrowdLinker%2Fnestjs-commons/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrowdLinker%2Fnestjs-commons/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrowdLinker%2Fnestjs-commons/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CrowdLinker","download_url":"https://codeload.github.com/CrowdLinker/nestjs-commons/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CrowdLinker%2Fnestjs-commons/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266127427,"owners_count":23880442,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["constants","dayjs","functions","helpers","middlewares","nestjs","nodejs","typescript"],"created_at":"2025-07-20T13:01:12.727Z","updated_at":"2025-07-20T13:02:11.402Z","avatar_url":"https://github.com/CrowdLinker.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NestJS Commons\n\nCommons for NestJS\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"http://nestjs.com/\" target=\"blank\"\u003e\n    \u003cimg src=\"https://nestjs.com/img/logo_text.svg\" width=\"380\" alt=\"Nest Logo\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## Packages\n\n- [Lodash](https://www.npmjs.com/package/lodash/v/4.17.21) - lodash (v4.17.21)\n\n## Installation\n\n```bash\nnpm install --save @crowdlinker/nestjs-commons\n// or\n// yarn add @crowdlinker/nestjs-commons\n```\n\n## Usage\n\n### Constants\n\n#### Example\n\n```ts\nimport dayjs from 'dayjs';\nimport { DATE_FORMAT } from '@crowdlinker/nestjs-commons/constants/date';\n\nnew days().format(DATE_FORMAT); // 2021-05-21\n```\n\n### Helpers\n\nHelpers are common functions used throughout the codebase for performing some basic operations.\n\n#### Example\n\n```ts\nimport { isLeapYear } from '@crowdlinker/nestjs-commons/helpers/date';\n\nif (isLeapYear()) {\n  // const noOfDays = 366;\n} else {\n  // const noOfDays = 365;\n}\n```\n\n### HttpExceptionFilter\n\nTo know about what an HttpExceptionFilter is, please read the [NestJS documentation](https://docs.nestjs.com/exception-filters#binding-filters).\n\n```ts\nimport { Module } from '@nestjs/common';\nimport { APP_FILTER } from '@nestjs/core';\nimport { AppService } from './app.service';\nimport { AppController } from './app.controller';\nimport { AppConfigService } from './config/app/config.service';\nimport { HttpExceptionFilter } from '@crowdlinker/nestjs-commons/exceptions/filters/http-exception';\n\n@Module({\n  imports: [\n    // ...\n  ],\n  controllers: [AppController],\n  providers: [\n    AppService,\n    {\n      provide: APP_FILTER,\n      useFactory: async (appConfigService: AppConfigService) =\u003e {\n        return new HttpExceptionFilter(appConfigService);\n      },\n    },\n  ],\n})\nexport class AppModule {}\n```\n\n**Note:** AppConfigService should implement AppConfigServiceInterface provided in `@crowdlinker/nestjs-commons/interfaces/config.interface. See example below:\n\n```ts\nimport { Injectable } from '@nestjs/common';\nimport { AppConfig } from './config.interface';\nimport { ConfigService } from '@nestjs/config';\nimport { AppConfigServiceInterface } from '@crowdlinker/nestjs-commons/interfaces/config';\n\n@Injectable()\nexport class AppConfigService implements AppConfigServiceInterface {\n  // ....\n}\n```\n\n## Important Points To Note\n\n- Code is written in Typescript (v5.4.3)\n\n## Contributors\n\n- Team @Crowdlinker ([Github](https://github.com/CrowdLinker) | [Bitbucket](https://bitbucket.org/crowdlinker/))\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrowdlinker%2Fnestjs-commons","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrowdlinker%2Fnestjs-commons","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrowdlinker%2Fnestjs-commons/lists"}