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

@chet-cloud/server_push

v0.0.25

Published

curl http://localhost:8000/events?token=<TOKEN_SECRET>&sub=a

Readme

Wait for message

curl http://localhost:8000/events?token=<TOKEN_SECRET>&sub=a

curl http://localhost:8000/events?token=<TOKEN_SECRET>&sub=b

Send message

curl -X POST -d 'hello' http://localhost:8000/events?token=<TOKEN_SECRET>&pub=a

curl -X POST -d 'hello' http://localhost:8000/events?token=<TOKEN_SECRET>&pub=b

Config in .env located in current work directory

TOKEN_SECRET=artisreit_2023_06_20
SERVER_PORT=8000

REDIS_ENDPOINT_URL=redis-13065.c56.east-us.azure.cloud.redislabs.com
REDIS_ENDPOINT_PORT=13065
REDIS_PASSWORD=xxxxxxxxxxxxxxxxxxxxxxxxxxx
REDIS_SUBSCRIBER_KEY=Server_push_redis_subscript_publish_key

example

  • start server
    npx @chet-cloud/server_push
  • reqeust to subscript the a and b
  curl 'http://localhost:8000/events?token=artisreit_2023_06_20&sub=a&sub=b&sub=c&sub=status'
  curl 'http://localhost:8000/events?token=artisreit_2023_06_20&sub=b'
  • send a message to clients that subscript a
  curl -X POST -d 'hello' 'http://localhost:8000/events?token=artisreit_2023_06_20&pub=a'
  • send a message to clients that subscript b
  curl -X POST -d 'world' 'http://localhost:8000/events?token=artisreit_2023_06_20&pub=b'
  • the build-in sub command status is used to subscribe all status of subscribe clients
  curl 'http://localhost:8000/events?token=artisreit_2023_06_20&sub=status'

  ## output   
  event: status
  data: [{"sessionId":"1701207747541Y3CKJGCc0eYdknTDp5qIdZmZss587P38","sub_set":["a","b","c","list"],"is_closed":true},{"sessionId":"1701207751146BYu54a7imcTaRgo7SKh3vJ7bArXmKq4I","sub_set":["list"],"is_closed":true},{"sessionId":"1701207775497mrS5pXIC8SENf2HJdjGvvCAxF7BMbZz1","sub_set":["a","b","c","status"]},{"sessionId":"17012077825699fGWd0eoIUAk8H2zEsZnk4MABnPioJB0","sub_set":["status"]},{"sessionId":"1701207819068IKJj8cDNqb07XMnSSvYcq7mINHDGmaQf","sub_set":["status"]}]
  id: 4
  • message filter
  ## will send message to client the subscribe b and sessionId is 1212
  curl -X POST -d 'world' 'http://localhost:8000/events?token=artisreit_2023_06_20&pub=b&sessionId=1212'

or

  1. open the url to open a chatroot named marketing
- `https://ruapp-kiosk.azurewebsites.net/events?token=artisreit_2023_06_20&sub=marketing`
  1. open the console of the chrome, send message "hello"
```js
  fetch('/events?token=artisreit_2023_06_20&pub=a', {method: 'POST', body: `
      Hello, I am Chet
  `})
```

or


<script>

    const eventSource = new EventSource('/events?token=artisreit_2023_06_20&sub=a&sub=b&sub=c',
      {withCredentials: true});

    eventSource.onopen = () => {
      console.log('Connection to server established');
    };
    eventSource.onmessage = (event) => {
      console.log('Received event:', event.data);
    };
    eventSource.onerror = (error) => {
      console.error('An error occurred:', error);
    };
    eventSource.addEventListener("a",(d)=>{
      console.log('Received data from event:[a]', event.data);
    })
    
    let i=0;
    setInterval(() => {
      fetch('/events?token=artisreit_2023_06_20&pub=a', {
        method: 'POST',
        body: "Hello world: " + (i++) 
      })
    }, 2000);
      
</script>

For express usage:

import {createExpressServer} from '@chet-cloud/server_push'

app.use(createExpressServer(()=>true));