mqtt-match
Version:
Match mqtt formatted topic strings to strings
28 lines (19 loc) • 901 B
Markdown
# mqtt-match
> Match mqtt formatted topic strings to strings
[](https://www.npmjs.com/package/mqtt-match)

[](https://github.com/ralphtheninja/mqtt-match/actions/workflows/node.js.yml)
[](https://standardjs.com)
## Usage
```js
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