
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
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 send commands and queries through a message broker (e.g. NATS, Redis, MQTT) to the appropriate handlers in microservices. It also provides a way to create sagas that can be used to handle events.
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<string> {
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<string> {
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
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.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.