
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
block-messenger
Advanced tools
Simplifies message exchange between pipeline blocks.
Factory Pattern simplifies replacement of Client.
MQTT Client is Implemented based on NPM mqtt package
To Create a MQTT Client using the BlockMessenger Factory
type = 'mqtt'
To receive messages, listen to event 'message' (topic, message) To publish a message, messenger.publish(some_data, callback);
'use strict';
const Messenger = require('block-messenger');
const options = {
clientId: 'test',
host: process.env.MQTT_HOST || '127.0.0.1',
port: process.env.MQTT_PORT || 1883,
username: process.env.MQTT_USERNAME,
password: process.env.MQTT_PASSWORD,
qos: 1
};
const mqtt = Messenger.mqtt(options);
console.log(options);
mqtt.on('subscribed', (granted) => {
console.log(granted);
});
mqtt.on('message', (topic, message) => {
console.log(`new message in topic ${topic}:`, message.toString());
});
mqtt.subscribe('aigent/test/in');
setInterval(() => {
mqtt.publish('aigent/test/out', {data: 'test data'})
.then(data => {
console.log('data published');
}).catch(err => {
console.error(err);
});
}, 1000);
connect
reconnect
close
offline
error
end
packetsend
packetreceive
message
subscribed
npm test
npm run-script test-cov
Transpile TypeScript into Javascript:
npm install
npm run-script build
npm publish
FAQs
Message exchange between pipeline blocks
We found that block-messenger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.