Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ralphtheninja/mqtt-match
Match mqtt formatted topic strings
https://github.com/ralphtheninja/mqtt-match
mqtt regexp
Last synced: about 10 hours ago
JSON representation
Match mqtt formatted topic strings
- Host: GitHub
- URL: https://github.com/ralphtheninja/mqtt-match
- Owner: ralphtheninja
- License: mit
- Created: 2016-06-08T20:27:11.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2022-01-11T10:45:53.000Z (almost 3 years ago)
- Last Synced: 2024-12-14T21:32:49.504Z (13 days ago)
- Topics: mqtt, regexp
- Language: JavaScript
- Size: 18.6 KB
- Stars: 22
- Watchers: 3
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mqtt-match
> Match mqtt formatted topic strings to strings
[![npm](https://img.shields.io/npm/v/mqtt-match.svg)](https://www.npmjs.com/package/mqtt-match)
![Node version](https://img.shields.io/node/v/mqtt-match.svg)
[![Node.js CI](https://github.com/ralphtheninja/mqtt-match/actions/workflows/node.js.yml/badge.svg)](https://github.com/ralphtheninja/mqtt-match/actions/workflows/node.js.yml)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](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