Socket
Socket
Sign inDemoInstall

@ignis-web/cqrs-cli

Package Overview
Dependencies
28
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @ignis-web/cqrs-cli

CLI package for package @ignis-web/cqrs


Version published
Weekly downloads
2
Maintainers
1
Created
Weekly downloads
 

Readme

Source

CQRS CLI

CLI library for code generation commands and queries with handlers for package @ignis-web/cqrs.

npm i @ignis-web/cqrs -S

Example

Creating file with types for command and query:

# example/module/user/type.ts

import { ICommand, IQuery, ICommandHandler, IQueryHandler } from '@ignis-web/cqrs';

export interface ICreateCommand extends ICommand<'user.create', { id: number; name: string }> { };
export interface ICreateHandler extends ICommandHandler<ICreateCommand> { };

export interface IGetByIdQuery extends IQuery<'user.get-by-id', number> { };
export interface IGetByIdHandler extends IQueryHandler<IGetByIdQuery, { id: number, name: string }> { };

Generate code:

npx create-cq -m example/module/user

Output:
example/module/user/
├── cq
│   ├── Create.command.ts
│   ├── Create.handler.ts
│   ├── GetById.handler.ts
│   └── GetById.query.ts
├── index.ts
└── type.ts

Options

-m, --module <path> – path of module
-f, --folder <path> – folder of Command/Query/Handler, by default is "cq"
-i, --index <path> – name of index file with Command/Query/Handler, by default is "index.ts"
--snake-case – enable snake case naming format of Command/Query/Handler, be default is disabled (camel case)

Keywords

FAQs

Last updated on 19 Aug 2023

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc