{"id":20576600,"url":"https://github.com/hobbyquaker/mqtt-wildcard","last_synced_at":"2025-04-14T18:22:43.668Z","repository":{"id":57303747,"uuid":"89857894","full_name":"hobbyquaker/mqtt-wildcard","owner":"hobbyquaker","description":"Match a MQTT Topic against Wildcards","archived":false,"fork":false,"pushed_at":"2018-05-09T20:49:34.000Z","size":16,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T06:51:10.689Z","etag":null,"topics":["match","mqtt","regex","topic","wildcard"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hobbyquaker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-30T15:06:41.000Z","updated_at":"2024-03-14T12:21:33.000Z","dependencies_parsed_at":"2022-08-24T17:11:40.556Z","dependency_job_id":null,"html_url":"https://github.com/hobbyquaker/mqtt-wildcard","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hobbyquaker%2Fmqtt-wildcard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hobbyquaker%2Fmqtt-wildcard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hobbyquaker%2Fmqtt-wildcard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hobbyquaker%2Fmqtt-wildcard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hobbyquaker","download_url":"https://codeload.github.com/hobbyquaker/mqtt-wildcard/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248478145,"owners_count":21110644,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["match","mqtt","regex","topic","wildcard"],"created_at":"2024-11-16T05:46:18.169Z","updated_at":"2025-04-14T18:22:43.633Z","avatar_url":"https://github.com/hobbyquaker.png","language":"JavaScript","funding_links":[],"categories":["Tools"],"sub_categories":["Talks"],"readme":"# mqtt-wildcard\n\n[![NPM version](https://badge.fury.io/js/mqtt-wildcard.svg)](http://badge.fury.io/js/mqtt-wildcard)\n[![Dependency Status](https://img.shields.io/gemnasium/hobbyquaker/mqtt-wildcard.svg?maxAge=2592000)](https://gemnasium.com/github.com/hobbyquaker/mqtt-wildcard)\n[![Build Status](https://travis-ci.org/hobbyquaker/mqtt-wildcard.svg?branch=master)](https://travis-ci.org/hobbyquaker/mqtt-wildcard)\n[![Coverage Status](https://coveralls.io/repos/github/hobbyquaker/mqtt-wildcard/badge.svg?branch=master)](https://coveralls.io/github/hobbyquaker/mqtt-wildcard?branch=master)\n[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)\n[![License][mit-badge]][mit-url]\n\n\u003e Match a MQTT Topic against Wildcards\n\n\n## Install and Usage\n\n```\n$ npm install mqtt-wildcard\n```\n\n```javascript\nvar mqttWildcard = require('mqtt-wildcard');\n```\n\nAlternatively you can use bower to install mqtt-wildcard, AMD is also supported.\n\n\n## API\n\n_array|null_ **mqttWildcard** **(**_string_ **topic,** _string_ **wildcard)**\n\nReturns `null` if not matched, otherwise an array containing the wildcards contents will be returned.\n\nExamples:\n```javascript\nmqttWildcard('test/foo/bar', 'test/foo/bar'); // []\nmqttWildcard('test/foo/bar', 'test/+/bar'); // ['foo']\nmqttWildcard('test/foo/bar', 'test/#'); // ['foo/bar']\nmqttWildcard('test/foo/bar/baz', 'test/+/#'); // ['foo', 'bar/baz']\nmqttWildcard('test/foo/bar/baz', 'test/+/+/baz'); // ['foo', 'bar']\n\nmqttWildcard('test', 'test/#'); // []\nmqttWildcard('test/', 'test/#'); // ['']\n\nmqttWildcard('test/foo/bar', 'test/+'); // null\nmqttWildcard('test/foo/bar', 'test/nope/bar'); // null\n```\n\n\n## License\n\nMIT (c) 2017 [Sebastian Raff](https://github.com/hobbyquaker)\n\n[mit-badge]: https://img.shields.io/badge/License-MIT-blue.svg?style=flat\n[mit-url]: LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhobbyquaker%2Fmqtt-wildcard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhobbyquaker%2Fmqtt-wildcard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhobbyquaker%2Fmqtt-wildcard/lists"}