Gathering detailed insights and metrics for async-mqtt-updated
Gathering detailed insights and metrics for async-mqtt-updated
Gathering detailed insights and metrics for async-mqtt-updated
Gathering detailed insights and metrics for async-mqtt-updated
npm install async-mqtt-updated
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
275 Stars
68 Commits
49 Forks
7 Watchers
1 Branches
17 Contributors
Updated on Jul 09, 2025
Latest Version
2.5.2
Package Id
async-mqtt-updated@2.5.2
Unpacked Size
16.45 kB
Size
4.65 kB
File Count
7
NPM Version
6.13.4
Node Version
10.19.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
4
Promise wrapper over MQTT.js
IMPORTANT: Make sure you handle rejections from returned promises because they won't crash the process
The API is the same as MQTT.js, except the following functions now return promises instead of taking callbacks
1const MQTT = require("async-mqtt"); 2 3const client = MQTT.connect("tcp://somehost.com:1883"); 4 5// When passing async functions as event listeners, make sure to have a try catch block 6 7const doStuff = async () => { 8 9 console.log("Starting"); 10 try { 11 await client.publish("wow/so/cool", "It works!"); 12 // This line doesn't run until the server responds to the publish 13 await client.end(); 14 // This line doesn't run until the client has disconnected without error 15 console.log("Done"); 16 } catch (e){ 17 // Do something about it! 18 console.log(e.stack); 19 process.exit(); 20 } 21} 22 23client.on("connect", doStuff);
Alternately you can skip the event listeners and get a promise.
1const MQTT = require("async-mqtt"); 2 3run() 4 5async function run() { 6 const client = await MQTT.connectAsync("tcp://somehost.com:1883") 7 8 console.log("Starting"); 9 try { 10 await client.publish("wow/so/cool", "It works!"); 11 // This line doesn't run until the server responds to the publish 12 await client.end(); 13 // This line doesn't run until the client has disconnected without error 14 console.log("Done"); 15 } catch (e){ 16 // Do something about it! 17 console.log(e.stack); 18 process.exit(); 19 } 20} 21
1const { AsyncClient } = require("async-mqtt"); 2 3const client = getRegularMQTTClientFromSomewhere(); 4 5const asyncClient = new AsyncClient(client); 6 7asyncClient.publish("foo/bar", "baz").then(() => { 8 console.log("We async now"); 9 return asyncClient.end(); 10});
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 9/20 approved changesets -- score normalized to 4
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More