Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
@homebridge/dbus-native
Advanced tools
Readme
D-bus protocol client and server for node.js
This fork is maintained with the following changes:
abstract-socket
dependency for faster installslong.js
fork to work around a crash on ARMv6
platforms running node 16.1+prettier
, which has made style changes to a lot of files)npm install dbus-native
or
git clone https://github.com/sidorares/node-dbus # clone the repo
cd node-dbus
npm install # install dependencies
sudo cp examples/com.github.sidorares.dbus.Example.conf /etc/dbus-1/system.d/ # if you want to test examples/service.js
Short example using desktop notifications service
var dbus = require('dbus-native');
var sessionBus = dbus.sessionBus();
sessionBus.getService('org.freedesktop.Notifications').getInterface(
'/org/freedesktop/Notifications',
'org.freedesktop.Notifications', function(err, notifications) {
// dbus signals are EventEmitter events
notifications.on('ActionInvoked', function() {
console.log('ActionInvoked', arguments);
});
notifications.on('NotificationClosed', function() {
console.log('NotificationClosed', arguments);
});
notifications.Notify('exampl', 0, '', 'summary 3', 'new message text', ['xxx yyy', 'test2', 'test3', 'test4'], [], 5, function(err, id) {
//setTimeout(function() { n.CloseNotification(id, console.log); }, 4000);
});
});
connection = dbus.createClient(options)
options:
DBUS_SESSION_BUS_ADDRESS
environment variable. See http://dbus.freedesktop.org/doc/dbus-specification.html#addressesconnection has only one method, message(msg)
message fields:
connection signals:
example:
var dbus = require('dbus-native');
var conn = dbus.createConnection();
conn.message({
path:'/org/freedesktop/DBus',
destination: 'org.freedesktop.DBus',
'interface': 'org.freedesktop.DBus',
member: 'Hello',
type: dbus.messageType.methodCall
});
conn.on('message', function(msg) { console.log(msg); });
Long.js is used for 64 Bit support. https://github.com/dcodeIO/long.js The following javascript types can be marshalled into 64 bit dbus fields:
By default 64 bit dbus fields are unmarshalled into a 'number' (with precision loss beyond 53 bits). Use {ReturnLongjs:true} option to return the actual Long.js object and preserve the entire 64 bits.
FAQs
D-bus protocol implementation in native javascript
The npm package @homebridge/dbus-native receives a total of 12,616 weekly downloads. As such, @homebridge/dbus-native popularity was classified as popular.
We found that @homebridge/dbus-native demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 9 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.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.