Queue-SDK
Queue-sdk is a npm module which helps you to integrate with Queue services like Redis and Kafka. The sdk also has its own simple in-memory queue implemented which uses array as datast. Of-course you do not want to use it for production, but good for testing purposes.
Install
npm i queue-sdk --save
Build
npm inpm run build
Use
//// Sample usage for REDIS queue const QueueSdk QTYPE = const url = "http://127.0.0.1:6379"const QueueConfig = QTYPEREDIS url; // Qtypes : SIMPLE (in-mem) | REDIS | KAFKA const NEWQUEUE = QueueConfig;let message = "Message to be pushed into queue" await NEWQUEUEclear; // it will clear all messages of queue but wil not delete the queuelet mid = await NEWQUEUE // push message into queuelet size = await NEWQUEUEsize // queue sizeawait NEWQUEUE // pop from queueconst channels = await NEWQUEUE // fetch all channelsawait NEWQUEUE // get all items from list
NPM publish
npm login
npm version major | minor | patch
npm publish