# mqtt-match

> Match mqtt formatted topic strings to strings

Latest version **3.0.0** (published 2022-01-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install mqtt-match
pnpm add mqtt-match
yarn add mqtt-match
bun add mqtt-match
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2022-01-11 |
| First published | 2016-06-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=12.0.0 |
| Dependencies | 0 |
| Unpacked size | 5.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 22 |
| Author | Lars-Magnus Skog |
| Maintainers | ralphtheninja |
| Keywords | mqtt, topic, match |

## Links

- npm: https://www.npmjs.com/package/mqtt-match
- Repository: https://github.com/ralphtheninja/mqtt-match
- Homepage: https://github.com/ralphtheninja/mqtt-match#readme
- Issues: https://github.com/ralphtheninja/mqtt-match/issues
- npm.io page: https://npm.io/package/mqtt-match

## Recent versions

- 3.0.0 (latest) — 2022-01-11
- 2.0.3 — 2019-06-18
- 2.0.2 — 2018-11-27
- 2.0.1 — 2018-08-05
- 2.0.0 — 2018-05-10
- 1.0.3 — 2017-08-22
- 1.0.2 — 2017-04-19
- 1.0.0 — 2016-06-08
- 0.0.0 — 2016-06-08

## 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

---
_Source: https://npm.io/package/mqtt-match · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
