{"id":28304103,"url":"https://github.com/csimi/nano-mqtt","last_synced_at":"2026-05-03T15:33:30.661Z","repository":{"id":47628019,"uuid":"228078370","full_name":"csimi/nano-mqtt","owner":"csimi","description":"Nano-sized MQTT client intended but not limited to be used on Espruino","archived":false,"fork":false,"pushed_at":"2024-10-12T07:29:24.000Z","size":537,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-04-13T23:06:37.242Z","etag":null,"topics":["espruino","mqtt","udp"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/csimi.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-14T19:36:45.000Z","updated_at":"2024-10-12T07:29:28.000Z","dependencies_parsed_at":"2024-11-18T14:02:58.916Z","dependency_job_id":"88dc9e3f-53eb-411d-8d4b-6ce608a985db","html_url":"https://github.com/csimi/nano-mqtt","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/csimi/nano-mqtt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csimi%2Fnano-mqtt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csimi%2Fnano-mqtt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csimi%2Fnano-mqtt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csimi%2Fnano-mqtt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/csimi","download_url":"https://codeload.github.com/csimi/nano-mqtt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/csimi%2Fnano-mqtt/sbom","scorecard":{"id":310931,"data":{"date":"2025-08-11","repo":{"name":"github.com/csimi/nano-mqtt","commit":"1829a44c26e86ec98b79321892ee489dd7f418ba"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.8,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/nodejs.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":4,"reason":"dependency not pinned by hash detected -- score normalized to 4","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/csimi/nano-mqtt/nodejs.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/nodejs.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/csimi/nano-mqtt/nodejs.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/nodejs.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/csimi/nano-mqtt/nodejs.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   1 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/24 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: license:0","Info: FSF or OSI recognized license: ISC License: license:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"14 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-2j2x-2gpw-g8fm","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T23:10:06.731Z","repository_id":47628019,"created_at":"2025-08-17T23:10:06.731Z","updated_at":"2025-08-17T23:10:06.731Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32575109,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T06:36:36.687Z","status":"ssl_error","status_checked_at":"2026-05-03T06:36:09.306Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["espruino","mqtt","udp"],"created_at":"2025-05-24T00:12:04.799Z","updated_at":"2026-05-03T15:33:30.653Z","avatar_url":"https://github.com/csimi.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm version](https://img.shields.io/npm/v/nano-mqtt.svg?logo=npm)](https://www.npmjs.com/package/nano-mqtt)\n[![build status](https://github.com/csimi/nano-mqtt/workflows/build/badge.svg)](https://github.com/csimi/nano-mqtt/actions)\n[![codecov](https://codecov.io/gh/csimi/nano-mqtt/branch/master/graph/badge.svg)](https://codecov.io/gh/csimi/nano-mqtt)\n\n# About\n\nThis package has been created with modularity in mind.\nYou don't need to import any networking related code if you're planning on reading messages from stdout and shouting them at random strangers (or more conveniently using a radio module).\n\nThe core is written in ES5 to be able to run on very basic interpreters as long as they support Uint8Array (e.g. Espruino).\n\nYou are in charge of listening for the generated messages and sending them to an interface.\n\n\nThis is made easier by the included adapters:\n\n* espruino-tcp\n* espruino-udp\n\n# Usage\n\nInstall using npm:\n\n```\n$ npm install nano-mqtt\n```\n\n## Node.js\n\n```\nconst nanoMQTT = require('nano-mqtt');\n\nconst nano = new nanoMQTT('device-uuid');\n```\n\n## Espruino TCP\n\n```\nconst nanoMQTT = require('nano-mqtt/lib');\nconst nanoTCP = require('nano-mqtt/lib/adapter/espruino-tcp');\n\nconst nano = nanoTCP(\n\tnew nanoMQTT('device-uuid'),\n\t'192.168.0.1',\n\t1883,\n\t10000, // connection timeout\n\t5000, // retry delay\n);\n```\n\n## Espruino UDP\n\n### Basic usage with a UDP broker\n\n```\nconst nanoMQTT = require('nano-mqtt/lib');\nconst nanoUDP = require('nano-mqtt/lib/adapter/espruino-udp');\n\nconst nano = nanoUDP(\n\tnew nanoMQTT('device-uuid'),\n\t'192.168.0.1',\n\t1883,\n);\n```\n\n### UDP mesh without broker\n\n```\nconst nanoMQTT = require('nano-mqtt/lib');\nconst nanoUDP = require('nano-mqtt/lib/adapter/espruino-udp');\n\nconst nano = nanoUDP(\n\tnew nanoMQTT('device-uuid'),\n\t'192.168.0.255',\n\t1883,\n\t1883,\n);\n```\n\n# API\n\n## Event: 'connected'\n\nEmitted after receiving a `CONNACK` packet or `setConnected` was called with true.\n\n```\nnano.on('connected', () =\u003e {\n\tconsole.log('we are connected to broker');\n});\n```\n\n## Event: 'disconnected'\n\nEmitted after `setConnected` was called with false.\n\n```\nnano.on('disconnected', () =\u003e {\n\tconsole.log('we have been disconnected from broker');\n});\n```\n\n## Event: 'message'\n\nEmitted after receiving a `PUBLISH` packet.\n\n* topic `\u003cstring\u003e`\n* payload `\u003cstring\u003e`\n\n```\nnano.on('message', (topic, payload) =\u003e {\n\tconsole.log('received message', topic, payload);\n});\n```\n\n## Event: 'data'\n\nEmitted when a packet has been generated and is ready to be sent.\n\n* packet `\u003cUint8Array\u003e`\n* type `\u003cnumber\u003e`\n\n```\nnano.on('data', (packet, type) =\u003e {\n\tconsole.log('packet has been generated');\n\tsocket.send(packet);\n});\n```\n\n## Event: 'error'\n\nEmitted when trying to parse an unknown packet.\n\n* packet `\u003cUint8Array\u003e`\n\n```\nnano.on('error', (packet) =\u003e {\n\tconsole.log('unknown packet', packet);\n});\n```\n\n## setConnected(isConnected)\n\n* isConnected `\u003cboolean\u003e`\n\nSets the connection status and emits the corresponding event (`connected` or `disconnected`).\n\n## connect()\n\nGenerates and emits a `CONNECT` packet.\n\n## disconnect()\n\nGenerates and emits a `DISCONNECT` packet.\n\n## publish(topic, payload, retain)\n\n* topic `\u003cstring\u003e`\n* payload `\u003cstring\u003e`\n* retain `\u003cboolean\u003e`\n\nGenerates and emits a `PUBLISH` packet. Retain is false by default.\n\n## subscribe(topic)\n\n* topic `\u003cstring\u003e`\n\nGenerates and emits a `SUBSCRIBE` packet.\n\n## parse(data)\n\n* data `\u003cUint8Array\u003e`\n\nParses data packet and emits the corresponding event, or `error` on unknown packet type.\nThe parsed packet is returned in the format of `[PACKET_INT_TYPE, ...value]`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsimi%2Fnano-mqtt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcsimi%2Fnano-mqtt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcsimi%2Fnano-mqtt/lists"}