@crunchwrapsupreme/ws-depression

npm (scoped) npm Node.js CI

ws-depression

Does ws-discovery via UDP UPnP. Forked from some dude. Thanks dude.

Requirements

  • node.js >= v18.0.0 (may work with other versions, tested with 18.0.0)

Documentation

Installation

npm i --save @crunchwrapsupreme/ws-depression

Credit

Built on top of a fork of https://github.com/do-/node-xml-toolkit

Using

import { discoverDevicesV4, discoverDevicesV6, deviceSocket } from 'ws-depression'

discoverDevicesV4().then(x => {
const transports = x.map(x => x.transports);
console.log(transports);
});

// ... initialize our cool socket first
deviceSocket(socket).then(deviceListener => {
deviceListener.on('match', match => console.log(match.transports));
});

The promises returned by the discover functions resolve with a list of ProbeMatch objects. The is also the socketFactory and deviceSocket functions which provides more options for initialization.

Generated using TypeDoc