npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

simple-ssdp

v1.0.2

Published

node.js basic ssdp implementation

Readme

simple-ssdp

A simple ssdp implementation for discovering UPnP services and devices on Node.js

Introduction

simple-ssdp supports the discovery of services using the ssdp protocol, according to UPnP 1.1 specification. It allows to advertise your services on your local network, receive advertisements from other services and ssdp:alive/ssdp:byebye notifications.

Installation

npm install simple-ssdp

Methods

When the start method is called, the device advertises all its services on the multicast address. It sends three discovery messages for the root device and one for each added service, all with method NOTIFY and ssdp:alive in the NTS header field. It will also automatically send unicast advertisements each time it receives search messages from other devices.

When the stop method is called, it sends a NOTIFY message with NTS ssdp:byebye indicating other devices that this device is going to leave the network. If a control points receive an ssdp:byebye message of any of the devices or services, it can assume that all are no longer available.

| Method | Description | |----------------------------|-------------------------------------------------------------------------------------------------------------| | start() | Starts the simple-ssdp service and allows us to discover, advertise our service and listen to notifications | | stop(callback) | Stops the simple-ssdp service so that no more messages are received, then executes the callback | | addService(usn) | Registers a service by its name (usn) for advertising it | | discover(st, host, port) | Sends an M-SEARCH message to discover services and devices on the local network, by default discovers all devices and services available | | getNumRegistered() | Returns the number of all registered services | | getALlRegisteredServices() | Returns an array of usn of the registered services |

When the discover method is called, the device will search for other devices and services on the local network. Other devices can answer to that search message advertising themselves. This can be handled with the following events.

Events

| Event | Description | |----------|-----------------------------------------------------------------------------| | discover | Receive JSON data response for an M-SEARCH discover message | | notify | Receive JSON NOTIFY message from other services (ssdp:alive or ssdp:byebye) | | error | Receive error string |

Configuration

Configuration for creating the simple-ssdp object. All are mandatory.

  • device_name: The name of your device, it will appear on the SSDP messages as part of your USN
  • port: Port of your service
  • location: Uri of the service description for your service
  • product: Name of your application or program, it will appear on the SSDP messages on the SERVER field
  • product_version: Version of your application or program, it will appear on the SSDP messages on the SERVER field

Example

// Create and configure simpleSSDP object
const simpleSSDP = require ("../index"),
    ssdp = new simpleSSDP({
        device_name: "ExampleDevice",
        port: 8000,
        location: "/xml/description.xml",
        product: "Example",
        product_version: "1.0"
    });

// Register services to advertise
ssdp.addService("urn:schemas-upnp-org:service:ExampleService:1");
ssdp.addService("urn:schemas-upnp-org:service:ExampleService:2");

// Start the advertising of services
ssdp.start();

// Event: service discovered
ssdp.on("discover", (data) => {
    console.log(data);
});

// Event: notification
ssdp.on("notify", (data) => {
    if (data.nts === "ssdp:alive") {
        console.log("Service alive");
    } else if (data.nts === "ssdp:byebye") {
        console.log("Service byebye");
    }
});

// Event: error
ssdp.on("error", (err) => {
    console.log(err);
});

// Discover all services on the local network
ssdp.discover();

// Stop after 5 seconds
setTimeout(() => ssdp.stop(() => {
    console.log("SSDP stopped");
}), 5000);