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

constellation-client

v1.0.5

Published

Client for Beam Constellation

Readme

Constellation

Build Status Coverage Status

This is a client for the Beam Constellation service, which replaces the Beam Liveloading system. You can use it to easily listen for Beam events from Node.

This library is based on a public specification of the protocol.

Installation

npm install --save constellation-client

Usage

After creating a Constellation client, simply listening for an event allows you to start receiving data immediately. The library will automatically connect, subscribe to events you are listening for, and it will reconnect automatically if it loses connection.

const constellation = new Constellation();
constellation.on('user:1:update', data => {
	// { "sparks": 10000 }
});

However, if you don't want to connect automatically, you can pass an options object, and then run constellation.connect() function when required.

const constellation = new Constellation({ autoConnect: false });
constellation.connect();

If you require authentication, you can pass either cookie (containing a Beam session cookie) or authorization (containing an OAuth Bearer token).

const constellation = new Constellation({ authorization: '...' });

You can manually send a message to the Constellation server by using constellation.send(method, params). A promise is returned once the Constellation server replies. The promise is rejected if Constellation responds with an error, or if the client is not currently connected to Constellation.

const constellation = new Constellation();
constellation.on('connected', () => {
	constellation.send('divide', { numerator: 16, denominator: 4 }).then(res => {
		// 4
	}).catch(err => {
		// { "code": 1000, "message": "Cannot divide by zero" }
	});
});

All possible options are:

  • autoConnect - Whether the client should automatically connect to the server. Defaults to true.
  • autoReconnect - Whether the client should automatically reconnect on disconnection. Defaults to true.
  • reconnectTime - The number of milliseconds to wait before a reconnection attempt. Defaults to 8000.
  • serverAddress - The address that the client should connect to. Defaults to wss://constellation.mixer.com
  • authorization - The OAuth Bearer token to authenticate with, if necessary.
  • cookie - The Beam session cookie to authenticate with, if necessary.

Reserved events (that will not get passed through to Constellation when listening for them) include:

  • connected
  • disconnected
  • reconnecting
  • error