Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

promisified-dbus-native

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

promisified-dbus-native - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

24

index.js

@@ -46,2 +46,3 @@ 'use strict';

const bus = createClient.apply(dbus, arguments);
const getService = bus.getService;

@@ -63,2 +64,25 @@ bus.getService = function(name) {

}
const getObject = bus.getObject;
bus.getObject = function(path, name, callback) {
if (typeof callback !== 'undefined') {
return getObject.apply(bus, arguments);
} else {
return bus.getService(path).getObject(name);
}
}
const getInterface = bus.getInterface;
bus.getInterface = function(path, objname, name, callback) {
if (typeof callback !== 'undefined') {
return getInterface.apply(bus, arguments);
} else {
return new Promise((resolve, reject) => {
bus.getService(path).getObject(objname)
.then(obj => resolve(obj.as(name)))
.catch(reject);
});
}
}
return bus;

@@ -65,0 +89,0 @@ }

2

package.json
{
"name": "promisified-dbus-native",
"version": "0.0.1",
"version": "0.0.2",
"description": "promisified dbus-native",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -6,7 +6,11 @@ const dbus = require('./');

const service = await bus.getService('org.freedesktop.DBus');
const obj = await service.getObject('/org/freedesktop/DBus');
const iface = await obj.as('org.freedesktop.DBus.Introspectable');
const result = await iface.Introspect();
let obj = await service.getObject('/org/freedesktop/DBus');
let iface = await obj.as('org.freedesktop.DBus.Introspectable');
let result = await iface.Introspect();
console.log(result);
obj = await bus.getObject('org.freedesktop.DBus', '/org/freedesktop/DBus');
iface = await bus.getInterface('org.freedesktop.DBus', '/org/freedesktop/DBus', 'org.freedesktop.DBus.Introspectable');
result = await iface.Introspect();
console.log(result);
})();
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc