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

interactive-websocket-cli

v1.5.0

Published

A websocket client for cli

Downloads

114

Readme

[I]nteractive [W]eb[s]ocket [C]ommand [L]ine [I]nterface

npm GitHub forks GitHub Release Date github npm stars

An interactive websocket utility suite

Installation

npm i -g interactive-websocket-cli

Usage

wscli

wscli provides an interactive websocket client/server

Usage: wscli [options] [command]

Options:
  -V, --version                          output the version number
  -p, --pipe                             Pipe stdin to server and server to stdout
  -t, --tab-size <t>                     Set the tab size (default: 2)
  -i, --in <files>                       Use files as input (default: [])
  -o, --out <file>                       Output to file
  -u, --ugly                             No pretty print
  -d, --time-format <format>             Set the timestamp format (default: "YYYY/MM/DD HH:mm:ss(SSS[ms])")
  --server-config <file or JSON string>  Use a JSON object for any websocket server options
  --client-config <file or JSON string>  Use a JSON object for any websocket client options
  -h, --help                             output usage information

Commands:
  listen <port>                          Listen for websocket connections on a port
  connect <address>                      Connect to a websocket at an address

Notes: 
  * Pipe (-p) must be enabled when using file inputs (--in)
  * Specifying multiple --in(s) will chain together each the files and feed them through one at a time
  * Enabling ugly print (--ugly) will ignore --tab-size
  * Adress will be completed (ex. echo.websocket.org => ws://echo.websocket.org, 9000 => ws://localhost:9000)
  * --server-config and --client-config expect a JSON string conforming to https://github.com/websockets/ws/blob/HEAD/doc/ws.md#new-websocketaddress-protocols-options
  * --time-format strings are based off of https://momentjs.com/

As a client

Run wscli connect [host]. Once you see the !!! Connected message, press h for help, all further commands are triggered by the correct keypress.


      [s] send a message to server

As a server

Server has special arguments

Usage: wscli listen [options] <port>

Listen for websocket connections on a port

Options:
  -q, --quiet  Disable client outputs on connection (default: false)
  -h, --help   output usage information

Run wscli listen [port], press h for help


      [s] open select prompt, used to select which connections are being displayed and will receive transmit messages. comma seperated numbers
      [S] print selected clients
      [t] transmits message to selected clients
      [b] broadcasts message to all clients
      [k] close selected clients
   

wstee

wstee provides a proxy websocket for monitoring websocket connections. By default it will pipe stdio to the websocket although files can be provided as in/output

Usage: wstee [options]

Options:
  -V, --version                          output the version number
  -p, --pipe                             Pipe stdin to server and server to stdout
  -t, --tab-size <t>                     Set the tab size (default: 2)
  -i, --in <files>                       Use files as input (default: [])
  -o, --out <file>                       Output to file
  -u, --ugly                             No pretty print
  -d, --time-format <format>             Set the timestamp format (default: "YYYY/MM/DD HH:mm:ss(SSS[ms])")
  --server-config <file or JSON string>  Use a JSON object for any websocket server options
  --client-config <file or JSON string>  Use a JSON object for any websocket client options
  --connect-incoming <port or address>   Open a port to allow one client to connect (default: [])
  --connect-outgoing <port or address>   Connect to server  (default: [])
  -h, --help                             output usage information

Notes: 
  * Pipe (-p) must be enabled when using file inputs (--in)
  * Specifying multiple --in(s) will chain together each the files and feed them through one at a time
  * Enabling ugly print (--ugly) will ignore --tab-size
  * Adress will be completed (ex. echo.websocket.org => ws://echo.websocket.org, 9000 => ws://localhost:9000)
  * --server-config and --client-config expect a JSON string conforming to https://github.com/websockets/ws/blob/HEAD/doc/ws.md#new-websocketaddress-protocols-options
  * --time-format strings are based off of https://momentjs.com/

Note

When using -p, wstee will instead display the bitrate of data being transfered