mqtt-match

Match mqtt formatted topic strings to strings


Keywords
mqtt, topic, match, regexp
License
MIT
Install
npm install mqtt-match@3.0.0

Documentation

mqtt-match

Match mqtt formatted topic strings to strings

npm Node version Node.js CI JavaScript Style Guide

Usage

const match = require('mqtt-match')
console.log(match('foo/+', 'foo/bar'))
// true

Api

match(filter, topic[, handleSharedSubscription])

  • filter (string) - mqtt filter topic, e.g. foo/+/bar
  • topic (string) - topic string, e.g. foo/314/bar
  • handleSharedSubscription (boolean) - set to true if handling $share/ filter topics

License

MIT