socket.io-cli
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

Socket.io CLI

npm npm npm

I often use python -m websockets <url> to connect to and test a web sockets server when developing. However, this doesn't work for Socket.io, so I've created a cli that should hopefully serve as a substitute.

Installation

# npm
npm i -g socket.io-cli
# yarn
yarn global add socket.io-cli

Usage

You can run the cli with socketio.

Aliases: socket-io, socketio-cli

socketio <url>

When sending a socket.io event, you send an event name, and some data. In this cli, the first argument is the event, and any following arguments are treated as data.

# my_event data1 data2 etc

Since everything is seperated by spaces, you can wrap your event name or data in "quotes" if you need to include any spaces. These quotes are then removed before sending the data.

# "My event" "{'message': 'hi'}"

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

Package Sidebar

Install

npm i socket.io-cli

Weekly Downloads

27

Version

0.2.0

License

MIT

Unpacked Size

13.9 kB

Total Files

14

Last publish

Collaborators

  • otterlord