Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
nestjs-cqrs-extra
Advanced tools
🚀 Library that provides additional features for the NestJS CQRS module.
A module for that provides additional features for the NestJS CQRS module.
Nest CQRS Extra is a module that provides additional features for the NestJS CQRS module. It provides a way to create a command bus and query bus that can be used to send commands and queries to the appropriate handlers. It also provides a way to create a command and query handler that can be used to handle commands and queries.
Features
$ npm install nestjs-cqrs-extra @nestjs/microservices nats
import { Module } from '@nestjs/common';
import { CqrsModule } from 'nestjs-cqrs-extra';
@Module({
imports: [
CqrsModule.forRoot({
options: { servers: ['nats://localhost:4222'] }
})
]
})
export class AppModule {}
You can change adapter to redis
or mqtt
by changing the adapter
option.
import { BaseCommand } from 'nestjs-cqrs-extra';
export class CreateUserCommand extends BaseCommand<number> {
constructor(public readonly name: string) {
super();
}
}
import { CommandHandler } from 'nestjs-cqrs-extra';
import { CreateUserCommand } from './create-user.command';
import { Controller } from '@nestjs/common';
@Controller()
export class UserCommandsController {
@CommandHandler(CreateUserCommand)
public createUser(command: CreateUserCommand): string {
return `User ${command.name} created`;
}
}
Also you can use @QueryHandler
and @EventHandler
decorators to handle queries and events.
import { CommandBus } from 'nestjs-cqrs-extra';
import { Injectable } from '@nestjs/common';
@Injectable()
export class UserService {
constructor(private readonly commandBus: CommandBus) {}
async createUser(name: string): Promise<number> {
return this.commandBus.execute(new CreateUserCommand(name));
}
}
FAQs
Library that provides additional features for the NestJS CQRS module.
The npm package nestjs-cqrs-extra receives a total of 1 weekly downloads. As such, nestjs-cqrs-extra popularity was classified as not popular.
We found that nestjs-cqrs-extra 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.