New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@knawat/advanced-client-module

Package Overview
Dependencies
Maintainers
3
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@knawat/advanced-client-module

This is a Client Proxy providing module.

1.0.3
Source
npm
Version published
Weekly downloads
1
-80%
Maintainers
3
Weekly downloads
 
Created
Source

Advanced NestJS Client Proxy Module

Sample usages

First import the package:

import { AdvancedClientModule } from "@knawat/advanced-client-module";

Registration:

    AdvancedClientModule.register({
        transport: 'TCP',
        options: {
          url: 'http://localhost:8080',
        },
    }),

Replace all MessagePattern with MessagePatternExtended and EventPattern with EventPatternExtended decorators to add NAMESPACE in calls.

Now add the processor to the main.ts as below:

  app
    .get(AdvancedClientDecoratorProcessorService)
    .processCustomDecorators(process.env.NAMESPACE, [...CONTROLLERS-WITH-EXTENDED-DECORATORS]);

In order to use microservice client you need to inject the SERVICE_CLIENT class:

  constructor(
    @Inject(SERVICE_CLIENT)
    private readonly client: ClientProxy,
  ) {}

FAQs

Package last updated on 21 Jul 2022

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