
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
mqtt-smarthome-connect
Advanced tools
Node module for MQTT-Smarthome
This Module is a wrapper around MQTT.js adding extra functionality to ease the handling of topics and payloads following the mqtt-smarthome architecture proposal.
$ npm install mqtt-smarthome-connect --save
const mqsh = require('mqtt-smarthome-connect');
mqsh.connect();
mqsh.subscribe('test/1', (topic, val) => {
console.log(val); // foo
});
mqsh.publish('test/1', 'foo');
function
Kind: global class
MqttSmarthome.subscribe
MqttSmarthome.publish
idSubscription
number
Params
string
= "mqtt://localhost"
object
- see all available options in the MQTT.js docs
object
object
- that'll overwrite options given in publish(topic, payload, options, callback)string
= "mqttsmarthome-<random>"
MqttSmarthome.subscribe
Just a convenience alias to subscribe
Kind: instance property of MqttSmarthome
MqttSmarthome.publish
Just a convenience alias to publish
Kind: instance property of MqttSmarthome
Kind: instance method of MqttSmarthome
Disconnect from the MQTT broker.
Kind: instance method of MqttSmarthome
Params
boolean
= false
- passing it to true will close the client right away, without waiting for the in-flight messages to be acked.function
- will be called when the client is closed.Reconnect to the MQTT broker.
Kind: instance method of MqttSmarthome
idSubscription
Kind: instance method of MqttSmarthome
Returns: idSubscription
- id
Params
string
messageCallback
=
number
Unregister a callback. If no registered callback on the corresponding topic is left a MQTT unsubscribe will be done.
Kind: instance method of MqttSmarthome
Returns: number
- remaining number of subscription on that topic
Params
idSubscription
- an id that was returned by the subscribe() method.Unsubscribe a whole topic with all its callbacks.
Kind: instance method of MqttSmarthome
Params
string
function
Publish a MQTT message. Payloads that are neither of type string
nor an instance of Buffer
will be JSON
stringified.
Kind: instance method of MqttSmarthome
Params
string
*
object
number
= 0
- QoS levelboolean
= false
- Retain Flagboolean
= false
- Mark as duplicate flagfunction
- Fired when the QoS handling completes, or at the next tick if QoS 0. An error occurs if client is disconnecting.Kind: event emitted by MqttSmarthome
Kind: event emitted by MqttSmarthome
Kind: event emitted by MqttSmarthome
Kind: event emitted by MqttSmarthome
Kind: event emitted by MqttSmarthome
Kind: event emitted by MqttSmarthome
Params
string
string
Mqtt.packet
- see https://github.com/mqttjs/mqtt-packet#publishfunction
Kind: global typedef
Params
string
string
| number
| boolean
| object
array
- If subscription was example/+/foo/bar this array contains the "+" in topic stringMqtt.packet
MIT © Simon Christmann and Contributors
FAQs
Node library for MQTT-Smarthome
The npm package mqtt-smarthome-connect receives a total of 0 weekly downloads. As such, mqtt-smarthome-connect popularity was classified as not popular.
We found that mqtt-smarthome-connect demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.