@ccmos/nestjs-amqplib
TypeScript icon, indicating that this package has built-in type declarations

0.0.10 • Public • Published

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Support us

Description

Nest framework TypeScript starter repository.

Installation

$ npm install @ccmos/nestjs-amqplib

Quick Start

// import
import { Module } from '@nestjs/common';
import { AmqplibModule } from '@ccmos/nestjs-amqplib';

@Module({
  imports: [
    AmqplibModule.forRoot({
      url: 'amqp://localhost'
    }),
  ],
})
export class AppModule {}

// service
import { Injectable } from '@nestjs/common';
import { AmqplibService } from '@ccmos/nestjs-amqplib';

@Injectable()
export class MyService {
  constructor(
    private amqplib: AmqplibService,
  ) {  }

  async helloWorld() {
    await amqplib.sendToQueue('testQueue', { hello: 'queue' });
    await service.publish('testExchange', 'testRoutingKey', {
      hello: 'exchange',
    });

  }
}

License

Nest is MIT licensed.

Readme

Keywords

none

Package Sidebar

Install

npm i @ccmos/nestjs-amqplib

Weekly Downloads

0

Version

0.0.10

License

MIT

Unpacked Size

358 kB

Total Files

48

Last publish

Collaborators

  • mosluce