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

streamx-js

v1.0.13

Published

Send data to the frontend in realtime using this library

Readme

streamx

Send data to the frontend in realtime using this library

installation

npm

npm install streamx-js

bun

bun add streamx-js

yarn

bun add streamx-js

Registration

You will need an API key and an instance-id to push and subscribe to messages. To get these you need a StreamX account

If you don't have an account with us already, head over to https://streamx.web.app/signup to create a free account

API Keys & StreamX instances

Once registered, Get your API key in Profile menu

A default instance will always be created for you but you can create your custom instances under the Instances menu

Once an Instance is created, you can copy the id to use in your APIs and streamx-js

Web

In your front-end, you can listen to messages like this

import Stream from 'streamx-js'

const streamConfig = {
  apiKey: "your-public-api-key",
  instanceID: "your-instance-id",
  channel: "your channel", // optional: default will be ABC
  baseUrl: "streamx-api-url", // optional: update according when running your own instance of streamx
  pollInterval: 30*60, // optional, the time (in seconds) before refreshing connection
}

const stream = new Stream(streamConfig)


// add events to listen to
stream.on('eventName', (data)=>{
  console.log(data)
})

stream.on('eventName2', (data)=>{
  console.log(data)
})

// listen on the channel provided in the config
stream.listen()

// or override the channel in config
stream.listen("channel")

// close subscription anytime when done
stream.destroy()

APIs

On your APIs, simply make a post request to our API in below format to push messages

Example in python

import requests
import json


headersList = {
 "Authorization": "67936f09181d9b0262116c15",
 "Content-Type": "application/json"
}

payload = json.dumps({
  "instanceID": "instance-45896",
  "channel":"accounts",
  "event": "top-up",
  "message": {
    "balance_before": 2580,
    "balance_after": 4580,
    "amount": 2000,
    "currency":"KES",
  }
})

response = requests.request("POST", "https://api.streamx.co.ke/publish", data=payload,  headers=headersList)

print(response.text)

Contributions

Feel free to contribute to this project. Your contributions will be very appreciated

🎉 Happy Coding 🎉