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

op-en-app-server

v0.1.5

Published

Socket.IO server that allows access to an MQTT broker.

Readme

Open Energy App Server

This is part of the Open Energy Project, a research project aiming to make it easier and faster to prototype smart energy services.

Description

This Node.js server is a bridge from MQTT to websockets using socket.io. The server is connected to an MQTT broker and relays all messages that the connected client requests.

If messages are published to the server, they are forwarded to the MQTT broker under the 'appserver/session/[id]' topic.

Installation

npm install -g op-en-app-server

Configuration

All configuration of the server is done via environment variables, as compliant with a 12 factor app.

See index.js for default config.

Starting the server

When installed as a global package, the server can simply be started by running:

op-en-app-server

Client example

Client example using socket.io client in a web app:

var socket = io.connect('http://localhost:5000');
socket.on('connect', function () {
  socket.on('mqtt', function (msg) {
    console.log(msg.topic+' '+msg.payload);
  });
  socket.emit('subscribe',{topic:'/some/sensor/data'});
});

When new clients connect to the server it publishes a "Connected" message on the MQTT path appserver/session/N/

When the clients publish by:

socket.emit('publish',{topic:'/path',payload:'test'});

The message ("test") will be sent to the path AppServer/session/{N}/{path}

Where N is the session id and path the topic in the emit command.

Testing

For development, there is a suite of Mocha unit tests, run them with

npm test

The test suite can also be run to ensure that the server is running and responding correctly in a different environment (like. remote server, docker, virtual machine etc.). In that case, the environment variable HOST specifies what server to test.

So if you want to test a server on the url op-en.se on port 5000 for example, you would run:

env HOST=http://op-en.se:5000 npm test