Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/onesy-me/amqp
AMQP
https://github.com/onesy-me/amqp
amaui amqp back-end backend js library node nodejs rabbitmq typescript utils web
Last synced: 10 days ago
JSON representation
AMQP
- Host: GitHub
- URL: https://github.com/onesy-me/amqp
- Owner: onesy-me
- License: mit
- Created: 2022-02-03T16:03:46.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-12-11T20:30:15.000Z (23 days ago)
- Last Synced: 2024-12-11T20:36:24.249Z (23 days ago)
- Topics: amaui, amqp, back-end, backend, js, library, node, nodejs, rabbitmq, typescript, utils, web
- Language: TypeScript
- Homepage: https://docs.onesy.me/library/amqp
- Size: 230 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
onesy AMQP
AMQP
MIT license
Production ready
100% test cov
Nodejs
Very simple code
Modern code
Junior friendly
Typescript
Made with :yellow_heart:
## Getting started
### Add
```sh
yarn add @onesy/amqp
```Add `amqplib` peer dependency.
```sh
yarn add amqplib
```### Use
```javascript
import OnesyAmqp from '@onesy/amqp';
// Make if you wanna a config file and
// inside of it add all the process.env related props
import Config from './config';// Make a new amqp instance
const onesyAmqp = new OnesyAmqp({
uri: Config.amqp.rabbitmq.uri,
queues: Config.amqp.rabbitmq.queues,
exchanges: Config.amqp.rabbitmq.exchanges,
});// Await for a channel
await onesyAmqp.channel;// Send to a queue
await onesyAmqp.send('a', 'a');// Check a queue
await onesyAmqp.checkQueue();// { queue: 'a', messageCount: 1, etc. }
```### Dev
Install
```sh
yarn
```Test
```sh
yarn test
```One time local setup
Install docker and docker-compose
- https://docs.docker.com/get-docker
- https://docs.docker.com/compose/installMake docker containers
```sh
yarn docker
```### Prod
Build
```sh
yarn build
```