{"id":30180928,"url":"https://github.com/streamich/mqtt-codec","last_synced_at":"2025-08-12T08:06:19.972Z","repository":{"id":57303706,"uuid":"300827623","full_name":"streamich/mqtt-codec","owner":"streamich","description":"Encoder/decoder for MQTT packets.","archived":false,"fork":false,"pushed_at":"2023-12-15T05:48:28.000Z","size":766,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-09T11:25:32.991Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/streamich.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2020-10-03T07:58:12.000Z","updated_at":"2020-10-07T20:45:05.000Z","dependencies_parsed_at":"2024-02-05T10:14:43.115Z","dependency_job_id":null,"html_url":"https://github.com/streamich/mqtt-codec","commit_stats":{"total_commits":100,"total_committers":2,"mean_commits":50.0,"dds":"0.010000000000000009","last_synced_commit":"aecd035cc91e31fa853248c1a92bd9e5ebf4bb6f"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":"streamich/tpl-ts-lib","purl":"pkg:github/streamich/mqtt-codec","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamich%2Fmqtt-codec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamich%2Fmqtt-codec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamich%2Fmqtt-codec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamich%2Fmqtt-codec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/streamich","download_url":"https://codeload.github.com/streamich/mqtt-codec/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/streamich%2Fmqtt-codec/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269754070,"owners_count":24470514,"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","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-08-12T08:06:07.797Z","updated_at":"2025-08-12T08:06:19.958Z","avatar_url":"https://github.com/streamich.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mqtt-codec\n\n- Fast MQTT packet encoder/decoder for Node.js.\n- `mqtt-codec` is 4-10x faster than `mqtt-packet` and uses less memory, see benchmarks below.\n- Zero dependencies.\n- TypeScript types included.\n\n## Benchmarks\n\nBefore running benchmarks:\n\n```\nyarn\nyarn build\n```\n\nMain benchmark, which creates a single parser and runs few packets through it:\n\n```\nnode benchmarks/decoding.js \nmqtt-codec x 57,063 ops/sec ±1.03% (89 runs sampled)\nmqtt-packet x 10,892 ops/sec ±1.86% (89 runs sampled)\nFastest is mqtt-codec\n```\n\nDecoding:\n\n```\nnode benchmarks/decoding-packets.js \nmqtt-codec (connectWithProperties) x 422,167 ops/sec ±1.29% (92 runs sampled)\nmqtt-packet (connectWithProperties) x 64,735 ops/sec ±1.33% (90 runs sampled)\nmqtt-codec (connackWithProperties) x 498,563 ops/sec ±0.64% (93 runs sampled)\nmqtt-packet (connackWithProperties) x 71,227 ops/sec ±1.56% (90 runs sampled)\nmqtt-codec (auth) x 871,222 ops/sec ±1.61% (90 runs sampled)\nmqtt-packet (auth) x 157,774 ops/sec ±1.81% (94 runs sampled)\nmqtt-codec (publishWithUserProperties) x 417,126 ops/sec ±0.69% (93 runs sampled)\nmqtt-packet (publishWithUserProperties) x 89,971 ops/sec ±1.47% (90 runs sampled)\nmqtt-codec (publishWithRepeatingProperties) x 585,985 ops/sec ±0.76% (93 runs sampled)\nmqtt-packet (publishWithRepeatingProperties) x 102,290 ops/sec ±1.42% (93 runs sampled)\nmqtt-codec (publish2Kb) x 2,412,971 ops/sec ±1.31% (92 runs sampled)\nmqtt-packet (publish2Kb) x 425,121 ops/sec ±0.55% (95 runs sampled)\nmqtt-codec (pubAckSimple) x 6,806,617 ops/sec ±1.66% (95 runs sampled)\nmqtt-packet (pubAckSimple) x 541,045 ops/sec ±0.39% (87 runs sampled)\nmqtt-codec (pubAckWithProperties) x 1,023,191 ops/sec ±0.36% (89 runs sampled)\nmqtt-packet (pubAckWithProperties) x 182,081 ops/sec ±2.83% (83 runs sampled)\nmqtt-codec (pubrec) x 1,045,032 ops/sec ±0.38% (93 runs sampled)\nmqtt-packet (pubrec) x 186,531 ops/sec ±2.25% (83 runs sampled)\nmqtt-codec (pubrel) x 1,058,224 ops/sec ±0.39% (95 runs sampled)\nmqtt-packet (pubrel) x 192,915 ops/sec ±1.54% (92 runs sampled)\nmqtt-codec (pubcomp) x 1,055,261 ops/sec ±1.38% (93 runs sampled)\nmqtt-packet (pubcomp) x 194,942 ops/sec ±1.72% (90 runs sampled)\nmqtt-codec (subscribe) x 835,892 ops/sec ±1.43% (93 runs sampled)\nmqtt-packet (subscribe) x 186,288 ops/sec ±1.44% (91 runs sampled)\nmqtt-codec (subscribeToThreeTopics) x 653,509 ops/sec ±0.49% (95 runs sampled)\nmqtt-packet (subscribeToThreeTopics) x 159,826 ops/sec ±2.11% (95 runs sampled)\nmqtt-codec (suback) x 1,002,423 ops/sec ±1.10% (95 runs sampled)\nmqtt-packet (suback) x 174,678 ops/sec ±1.90% (90 runs sampled)\nmqtt-codec (unsubscribe) x 876,241 ops/sec ±1.31% (93 runs sampled)\nmqtt-packet (unsubscribe) x 199,523 ops/sec ±1.69% (92 runs sampled)\nmqtt-codec (unsuback) x 1,006,423 ops/sec ±1.44% (94 runs sampled)\nmqtt-packet (unsuback) x 187,686 ops/sec ±1.59% (90 runs sampled)\nmqtt-codec (pingreq) x 5,023,004 ops/sec ±0.45% (94 runs sampled)\nmqtt-packet (pingreq) x 721,513 ops/sec ±2.40% (92 runs sampled)\nmqtt-codec (pingresp) x 4,824,193 ops/sec ±0.49% (97 runs sampled)\nmqtt-packet (pingresp) x 726,262 ops/sec ±2.14% (91 runs sampled)\nmqtt-codec (disconnect) x 847,186 ops/sec ±0.62% (95 runs sampled)\nmqtt-packet (disconnect) x 162,225 ops/sec ±1.77% (85 runs sampled)\nFastest is mqtt-codec (pubAckSimple)\n```\n\nEncoding:\n\n```\nnode benchmarks/encoding-packets.js \nmqtt-codec (connectWithProperties) x 340,320 ops/sec ±1.03% (89 runs sampled)\nmqtt-packet (connectWithProperties) x 78,694 ops/sec ±0.65% (91 runs sampled)\nmqtt-codec (connackWithProperties) x 475,541 ops/sec ±0.80% (89 runs sampled)\nmqtt-packet (connackWithProperties) x 85,971 ops/sec ±0.64% (90 runs sampled)\nmqtt-codec (auth) x 761,170 ops/sec ±0.88% (91 runs sampled)\nmqtt-packet (auth) x 220,458 ops/sec ±0.86% (92 runs sampled)\nmqtt-codec (publishWithUserProperties) x 476,999 ops/sec ±0.97% (88 runs sampled)\nmqtt-packet (publishWithUserProperties) x 113,824 ops/sec ±0.75% (90 runs sampled)\nmqtt-codec (publishWithRepeatingProperties) x 592,074 ops/sec ±0.86% (89 runs sampled)\nmqtt-packet (publishWithRepeatingProperties) x 123,382 ops/sec ±1.02% (91 runs sampled)\nmqtt-codec (publish2Kb) x 603,189 ops/sec ±1.94% (79 runs sampled)\nmqtt-packet (publish2Kb) x 552,224 ops/sec ±1.44% (84 runs sampled)\nmqtt-codec (pubAckSimple) x 2,045,370 ops/sec ±0.46% (90 runs sampled)\nmqtt-packet (pubAckSimple) x 1,323,745 ops/sec ±1.27% (93 runs sampled)\nmqtt-codec (pubAckWithProperties) x 960,848 ops/sec ±0.60% (94 runs sampled)\nmqtt-packet (pubAckWithProperties) x 288,869 ops/sec ±0.89% (95 runs sampled)\nmqtt-codec (pubrec) x 952,284 ops/sec ±0.45% (93 runs sampled)\nmqtt-packet (pubrec) x 283,084 ops/sec ±0.99% (93 runs sampled)\nmqtt-codec (pubrel) x 950,473 ops/sec ±0.51% (92 runs sampled)\nmqtt-packet (pubrel) x 285,300 ops/sec ±0.45% (96 runs sampled)\nmqtt-codec (pubcomp) x 949,344 ops/sec ±0.54% (96 runs sampled)\nmqtt-packet (pubcomp) x 289,744 ops/sec ±0.40% (96 runs sampled)\nmqtt-codec (subscribe) x 856,080 ops/sec ±1.05% (87 runs sampled)\nmqtt-packet (subscribe) x 253,906 ops/sec ±0.46% (95 runs sampled)\nmqtt-codec (subscribeToThreeTopics) x 622,374 ops/sec ±0.57% (93 runs sampled)\nmqtt-packet (subscribeToThreeTopics) x 198,086 ops/sec ±0.50% (93 runs sampled)\nmqtt-codec (suback) x 935,755 ops/sec ±0.29% (95 runs sampled)\nmqtt-packet (suback) x 293,072 ops/sec ±0.38% (95 runs sampled)\nmqtt-codec (unsubscribe) x 763,717 ops/sec ±0.71% (92 runs sampled)\nmqtt-packet (unsubscribe) x 290,084 ops/sec ±0.74% (95 runs sampled)\nmqtt-codec (unsuback) x 938,670 ops/sec ±0.29% (93 runs sampled)\nmqtt-packet (unsuback) x 289,862 ops/sec ±0.33% (96 runs sampled)\nmqtt-codec (pingreq) x 130,346,933 ops/sec ±2.35% (84 runs sampled)\nmqtt-packet (pingreq) x 3,694,792 ops/sec ±1.80% (93 runs sampled)\nmqtt-codec (pingresp) x 943,508,360 ops/sec ±1.35% (87 runs sampled)\nmqtt-packet (pingresp) x 3,612,333 ops/sec ±0.52% (93 runs sampled)\nmqtt-codec (disconnect) x 812,689 ops/sec ±0.61% (95 runs sampled)\nmqtt-packet (disconnect) x 217,743 ops/sec ±0.31% (96 runs sampled)\nFastest is mqtt-codec (pingresp)\n```\n\nYou can also run micro-benchmarks to see memory consumption:\n\n```\nnode benchmarks/micro/mqtt-codec.js \nTotal packets 10000000\nTotal time 3.61\nPackets/s 2.77M\nMemory used 5.43 Mb\n\nnode benchmarks/micro/mqtt-packet.js \nTotal packets 10000000\nTotal time 20.41\nPackets/s 0.49M\nMemory used 8.89 Mb\n```\n\n## License\n\n[MIT © Vadim Dalecky](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstreamich%2Fmqtt-codec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstreamich%2Fmqtt-codec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstreamich%2Fmqtt-codec/lists"}