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

@nestjs/microservices

Package Overview
Dependencies
Maintainers
0
Versions
366
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nestjs/microservices

Nest - modern, fast, powerful node.js web framework (@microservices)

  • 10.4.15
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
929K
increased by4.92%
Maintainers
0
Weekly downloads
 
Created

What is @nestjs/microservices?

@nestjs/microservices is a package for building microservice-based applications using the NestJS framework. It provides a set of tools and abstractions to create and manage microservices, allowing for communication between different parts of an application through various transport layers such as TCP, Redis, NATS, MQTT, and more.

What are @nestjs/microservices's main functionalities?

TCP Transport

This feature allows you to create a microservice that communicates over TCP. The code sample demonstrates how to set up a TCP microservice using NestFactory.

const app = await NestFactory.createMicroservice(AppModule, { transport: Transport.TCP, options: { host: '127.0.0.1', port: 8877 } }); app.listen(() => console.log('Microservice is listening'));

Redis Transport

This feature allows you to create a microservice that communicates over Redis. The code sample shows how to set up a Redis microservice using NestFactory.

const app = await NestFactory.createMicroservice(AppModule, { transport: Transport.REDIS, options: { url: 'redis://localhost:6379' } }); app.listen(() => console.log('Microservice is listening'));

NATS Transport

This feature allows you to create a microservice that communicates over NATS. The code sample demonstrates how to set up a NATS microservice using NestFactory.

const app = await NestFactory.createMicroservice(AppModule, { transport: Transport.NATS, options: { url: 'nats://localhost:4222' } }); app.listen(() => console.log('Microservice is listening'));

MQTT Transport

This feature allows you to create a microservice that communicates over MQTT. The code sample shows how to set up an MQTT microservice using NestFactory.

const app = await NestFactory.createMicroservice(AppModule, { transport: Transport.MQTT, options: { url: 'mqtt://localhost:1883' } }); app.listen(() => console.log('Microservice is listening'));

gRPC Transport

This feature allows you to create a microservice that communicates over gRPC. The code sample demonstrates how to set up a gRPC microservice using NestFactory.

const app = await NestFactory.createMicroservice(AppModule, { transport: Transport.GRPC, options: { package: 'hero', protoPath: join(__dirname, './hero.proto') } }); app.listen(() => console.log('Microservice is listening'));

Other packages similar to @nestjs/microservices

FAQs

Package last updated on 09 Dec 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