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

@tudelft/bluesky

v1.0.2

Published

Javascript client for the BlueSky open-source ATM simulator

Readme

bluesky-js

Bluesky-JS is a client-side JavaScript library for interacting with a BlueSky simulation server using WebSockets.

Installation

BlueSky-js is available on NPM. You can install it as dependency in your project using:

npm install bluesky

You can also import it directly with a <script> tag in HTML:

<script src="https://unpkg.com/@tudelft/bluesky@latest/dist/bluesky.js"></script>

This makes bluesky available in the global namespace, exposing bluesky.client and bluesky.stack.

Example usage:

Javascript module

import { client, stack } from '@tudelft/bluesky';

// Connect to server
client.connect('localhost', { port: 8080 });

// Subscribe to a topic
client.subscribe('mytopic', (event) => {
  console.log('Received:', event.data);
});

// Register a command
stack.command('greet', (name) => {
  console.log(`Hello, ${name}!`);
});

// Execute a command
stack.stack('greet Alice');

HTML

<script src="https://unpkg.com/@tudelft/bluesky@latest/dist/bluesky.js"></script>

<script>
// Connect to server
bluesky.client.connect('localhost', { port: 8080 });

// Subscribe to a topic, and log data to console when received
bluesky.client.subscribe('mytopic', (event) => {
  console.log('Received:', event.data);
});

// Register a new stack command
bluesky.stack.command('greet', (name) => {
  console.log(`Hello, ${name}!`);
});

// Execute a command
bluesky.stack.stack('greet Alice');
</script>

Client

File: client.js

The Client class manages the WebSocket connection, subscriptions, and shared state synchronization.

Key Methods

connect(hostname, options): Connects to the WebSocket server.

  • hostname: Server address (default: '127.0.0.1')
  • options: { port: 8080, clientId: null }

setActNode(nodeId): Sets the active simulation node.

  • nodeId: Network ID of the simulation node to set as active

isConnected(): Returns true if the WebSocket is open.

send(topic, data, toGroup): Sends a message to the server.

  • topic: Topic of the message to send. Nodes that want to receive this message can subscribe to this topic.
  • data: data to send.
  • toGroup: Group mask to send data to (optional)

subscribe(topic, func, broadcast, raw, actonly, fromGroup, toGroup): Subscribes to a topic.

  • topic: Topic of the message to subscribe to
  • func: The function to be called when data of this topic is received.
  • broadcast: When set to false, only messages explicitly directed at this client will be received.
  • raw: In case of sharedstate messages, receive the pre-processed data in the callback function.
  • actonly: Only receive broadcast data for the current active node.
  • fromGroup: Sender mask for subscription
  • toGroup: Destination mask for subscription

unsubscribe(topic, fromGroup, toGroup): Unsubscribes from a topic.

  • topic: Topic of the message to unsubscribe from
  • fromGroup: Sender mask for subscription
  • toGroup: Destination mask for subscription

Stack

File: stack.js

The Stack class manages command parsing and forwarding.

Key Methods

stack(cmdline): Parses and executes or forwards a command. When a command doesn't exist within this client, the command is forwarded to the active node.

  • cmdline: The commandline string to process or send on.

forward(cmdline, targetId): Forwards a command to another node.

  • cmdline: The commandline string to forward.
  • targetId: Network ID of the node to send the command to.

command(name, func, options): Registers a new command.

  • name: Name of the new command
  • func: Function to call when this command is parsed.

Command Options

  • brief: Short description.
  • aliases: Alternative names of the command.
  • annotations: Types of each argument.
  • help: Specify a help text for the new command.