Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nestjs-architects/typed-cqrs

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nestjs-architects/typed-cqrs

Enhance the @nestjs/cqrs building blocks with auto-inferring types.

  • 2.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
13K
decreased by-30.71%
Maintainers
1
Weekly downloads
 
Created
Source

@nestjs-architects/typed-cqrs

version downloads

Tired of hand-typing types for NestJS CQRS package? We got you covered!

Usage

First install base @nestjs/cqrs package.

$ npm i @nestjs/cqrs

All you need to do, is to extend your query with type of expected response.

import { Query } from '@nestjs-architects/typed-cqrs';

export class GetProfileQuery extends Query<ResultType> {}

Profit

Now, when implementing handler, you get all type completion & safety!

showcase-handler

import { IInferredQueryHandler, QueryHandler } from '@nestjs/cqrs';

@QueryHandler(GetProfileQuery)
export class GetProfileHandler implements IInferredQueryHandler<GetProfileQuery> {}

As well as, results are correctly typed as well! showcase-handler

Development - verify if package works

After running npm run build, run npm link from the root directory to have it visible as globally installed package.

Next, in the project you want to use it, within its root directory, run npm link @nestjs-architects/typed-cqrs

Keywords

FAQs

Package last updated on 04 Sep 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc