Pushert is a Command Line Interface (CLI) application for testing Pusher methods. With Pushert, you can easily configure Pusher credentials, publish messages to Pusher channels, and subscribe to events on Pusher channels.
npm install --global pushert
or
npm i -g pushert
Using Yarn
yarn global add pushert
The Pusher CLI stores your Pusher credentials in a configuration file named .pusher-config.json
.
On Unix
/home/{username}/.config/.pushert-config.json
On Window
C:\Users\{username}\.pushert-config.json
Configuration file contains the following:
{
"appId": string,
"key": string,
"secret" : string,
"cluster": string
"tls": boolean,
}
Before using the Pushert, you need to configure your Pusher credentials by running the following command:
pushert config
Follow the prompts to enter your Pusher API Key, API Secret and other options.
or
You can manually edit the file using Text editor.
To publish a message to a Pusher channel and event, use the publish command:
pushert publish <channel> <event> <message>
Paramater | Description |
---|---|
<channel> |
The name of the Pusher channel. |
<message> |
The message you want to send. It should be a valid JSON object. |
<event> |
The name of the event to trigger. |
Example
pushert publish my-channel my-event 'Hello, Pusher!'
or
pushert publish my-channel my-event '{"message": "Hello, Pusher!"}'
To subscribe to a Pusher channel and event, use the subscribe command:
pushert subscribe <channel> <event>
Paramater | Description |
---|---|
<channel> |
The name of the Pusher channel. |
<event> |
The name of the event you want to subscribe to. |
Example
pushert subscribe my-channel my-event
npm uninstall -g pushert
or
npm remove -g pushert
Using Yarn
yarn global remove pushert
- Pusher for their real-time messaging platform.
- Commander for the command-line interface framework.
- dotenv for managing environment variables.
This project is licensed under the MIT License - see the LICENSE.md file for details.
Feisal Ali
For any inquiries, please contact me via dev.feisalramar@gmail.com
Facebook, tiktok, youtube, instagram as "feisalramar"
fxl_pro