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

emitra-js

v2.0.5

Published

Free lightweight real-time WebSocket client for event-driven apps

Readme

⚡ Emitra

Free, lightweight real-time WebSocket client for building event-driven applications.

100% Free Forever — no credit card, no trial limits. Get your free App Key at evnt-flow.com and start streaming events in minutes.

npm license


🚀 Installation

npm install emitra-js

🔑 Get Your Free App Key

  1. Go to evnt-flow.com
  2. Create a free account
  3. Copy your App Key from the dashboard
  4. Use it in the code below — that's it!

⚡ Quick Start

import Emitra from 'emitra-js'

const ef = new Emitra('YOUR_APP_KEY')
const channel = ef.subscribe('my-channel')

// Listen for incoming messages from OTHER clients
// Note: sender does NOT receive their own messages
channel.on('my-event', (data) => {
  console.log('Received:', data)
})

// Send a message — other subscribers will receive it
channel.trigger('my-event', { message: 'hello world' })

⚠️ Important: The sender does not receive their own messages. Only other subscribers on the same channel will receive them. To test, open two browser tabs or run two Node.js processes.


🌐 Browser Usage

<script src="https://cdn.socket.io/4.8.1/socket.io.min.js"></script>
<script src="https://cdn.evnt-flow.com/emitra/v1/emitra.min.js"></script>

<script>
const ef = new Emitra('YOUR_APP_KEY')
const channel = ef.subscribe('my-channel')

channel.on('my-event', (data) => {
  console.log('Received:', data)
})

channel.trigger('my-event', { message: 'hello world' })
</script>

✨ Features

| | Feature | |---|---| | 🆓 | Free forever — no hidden fees, no paywalls | | ⚡ | Real-time communication via WebSocket | | 🧩 | Channel-based pub/sub architecture | | 🔁 | Automatic reconnection with exponential backoff | | 🪶 | Lightweight (~5KB) and zero config | | 🔒 | Secure WSS connections | | 📦 | Works in Node.js and Browser |


📦 API Reference

new Emitra(appKey, options?)

Create a new client instance.

| Parameter | Type | Description | |---|---|---| | appKey | string | Required. Your App Key from evnt-flow.com | | options.host | string | WebSocket server URL (default: wss://wss.evnt-flow.com) | | options.debug | boolean | Enable debug console logs (default: false) |

const ef = new Emitra('YOUR_APP_KEY', { debug: true })

ef.subscribe(channelName)EmitraChannel

Subscribe to a channel. Returns a channel object.

const channel = ef.subscribe('chat-room')

channel.on(eventName, callback)this

Listen for a specific event on this channel.

channel.on('new-message', (data) => {
  console.log(data)
})

channel.trigger(eventName, data)this

Send an event to the channel. All other subscribers will receive it.

channel.trigger('new-message', { text: 'Hi there!' })

💡 The sender is excluded from the broadcast — only other clients receive the message.


channel.off(eventName)this

Remove an event listener.

channel.off('new-message')

ef.unsubscribe(channelName)

Unsubscribe from a specific channel.


ef.disconnect()

Disconnect from the server and clean up all subscriptions.


ef.onError(callback)

Listen for server-side errors (subscription errors, rate limit blocks, etc.)

ef.onError((err) => {
  console.error('Emitra error:', err)
})

ef.connected()boolean

Check if the client is currently connected.


🧪 Testing

To test message delivery locally:

  1. Open two terminals (or two browser tabs)
  2. Both connect with the same App Key and subscribe to the same channel
  3. Send from one → receive in the other

The sender never receives their own messages — this is by design.


📁 Example

See the /example folder for a full interactive test client with UI.


🆓 Pricing

Emitra is free forever with generous limits:

  • ✅ 50 messages/sec
  • ✅ 500 peak connections
  • ✅ 1 App Key
  • ✅ Unlimited channels

Need more? Check out paid plans at evnt-flow.com.


📄 License

MIT © Emitra