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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@foxglove/ws-protocol-examples

v0.8.2

Published

Foxglove WebSocket protocol examples

Downloads

72

Readme

Foxglove WebSocket examples

This package provides example server and client implementations of the Foxglove WebSocket protocol. The protocol enables Foxglove to ingest arbitrary “live” streamed data.

To list all possible actions, run the following command:

$ npx @foxglove/ws-protocol-examples@latest --help

Example servers

Run the sysmon example server, which uses JSON-encoded data to transmit system monitoring information like memory and CPU usage:

$ npx @foxglove/ws-protocol-examples@latest sysmon

Run the image-server example server, which uses JSON-encoded data to transmit images:

$ npx @foxglove/ws-protocol-examples@latest image-server

Run the mcap-play example server, which plays back recorded data from a local MCAP file:

$ npx @foxglove/ws-protocol-examples@latest mcap-play <file> [--rate 1.0] [--loop]

Note: You must exit each server (control + c) before starting up another.

To see data from any server, open Foxglove with a Foxglove WebSocket connection to ws://localhost:8765/:

Example clients

Run a simple example client that subscribes to messages with the protobuf or json encoding:

$ npx @foxglove/ws-protocol-examples@latest simple-client ws://localhost:8765

Run a client that advertises the /chatter topic and publishes messages to it with json or ros1 encoding:

$ npx @foxglove/ws-protocol-examples@latest publish-client -e json ws://localhost:8765

Connect to a server and record message data into an MCAP file:

$ npx @foxglove/ws-protocol-examples@latest mcap-record ws://localhost:8765 -o <file.mcap>

Development

This package lives inside a monorepo that uses yarn workspaces, so most commands (other than yarn install) should be prefixed with yarn workspace @foxglove/ws-protocol-examples ....

  • yarn install – Install development dependencies
  • yarn workspace @foxglove/ws-protocol-examples version --patch (or --minor or --major) – Increment the version number and create the appropriate git tag
  • yarn workspace @foxglove/ws-protocol-examples run-example --help – Run the example scripts