UNPKG
pubsubr
Version:
latest (0.1.5)
0.1.5
0.1.4
0.1.3
0.1.1
0.1.0
0.0.3
0.0.2
0.0.1
pub and sub to loopback components
github.com/FengYuHe/pubsubr
FengYuHe/pubsubr
pubsubr
/
example
/
client.js
8 lines
(6 loc)
•
226 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
const
pubsubr =
require
(
'../index'
);
const
client =
new
pubsubr.
client
(
'mqtt://test.mosquitto.org'
); client.
subscribe
(
'/test/+/model/+/oid/+/action/+'
,
function
(
err, payload
) {
console
.
log
(err);
console
.
log
(payload); });