https://github.com/strongloop/strong-pubsub-primus
Primus compatibility layer for strong-pubsub.
https://github.com/strongloop/strong-pubsub-primus
Last synced: 8 months ago
JSON representation
Primus compatibility layer for strong-pubsub.
- Host: GitHub
- URL: https://github.com/strongloop/strong-pubsub-primus
- Owner: strongloop
- License: other
- Created: 2015-03-17T23:18:07.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2018-10-07T04:31:01.000Z (over 7 years ago)
- Last Synced: 2025-06-09T07:56:03.965Z (8 months ago)
- Language: JavaScript
- Homepage: http://github.com/strongloop/strong-pubsub
- Size: 18.6 KB
- Stars: 6
- Watchers: 20
- Forks: 4
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- License: LICENSE
Awesome Lists containing this project
README
# strong-pubsub-primus
[Primus](https://www.npmjs.com/package/primus) compatibility layer for [`strong-pubsub`][strong-pubsub-repo].
## Installation
```
npm install --save strong-pubsub-primus
```
## Use
Create a client as you would normally do using [`strong-pubsub`][strong-pubsub-repo] and pass in the Primus transport as the third argument:
```js
var Client = require('strong-pubsub');
var Adapter = require('strong-pubsub-mqtt');
var PrimusTransport = require('strong-pubsub-primus'); // require the primus tranport
var client = new Client({
host: 'localhost',
port: 1883
}, Adapter, PrimusTranport); // pass it in as the third argument
```
**NOTE**: You will need a preconfigured Primus server to act as the broker.
[strong-pubsub-repo]: https://github.com/strongloop/strong-pubsub