node-upnp
Version:
Modern UPnP Client Library
68 lines (37 loc) • 1.59 kB
Markdown
//img.shields.io/npm/v/node-upnp.svg?style=flat-square)](https://www.npmjs.com/package/node-upnp)
[](https://www.npmjs.com/package/node-upnp)
Modern UPnP client with async/await support and sane extensible codebase.
`npm i node-upnp`
```js
const UPnPClient = require('node-upnp');
const client = new UPnPClient({
url: 'http://192.168.1.150:44042/some.xml'
});
const desc = await client.getDeviceDescription();
console.log('Device', desc);
```
returns device description
returns service description
calls `actionName` for `serviceId` with `data` and return a result
subscribes for `serviceId` service updates. Keeps the subsription alive.
unsubscribes from `serviceId` service updates.
returns `true/false` is the client has any active subscriptions
clears all subscriptions
subscribes on the variable change event. Options:
* force — Boolean, when true, subscribes on the service even if variable is `sendEvents='no'` in the service description. This options is for variable included in `LastChange` event.
License MIT
[![NPM Version](https: