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 🙏

© 2025 – Pkg Stats / Ryan Hefner

sockster

v1.0.1

Published

A lightweight, production-ready WebSocket server that broadcasts all events to connected clients

Readme

🔌 sockster

A lightweight, blazing-fast WebSocket server that broadcasts all events to connected clients. Perfect for real-time applications, chat systems, or any project requiring WebSocket functionality.

npm version Docker Pulls License: MIT

✨ Features

  • 🎯 Simple to use - Just start the server and it broadcasts all events
  • 🔄 Universal Broadcasting - Every event is automatically broadcast to all connected clients
  • 🛡️ Production Ready - Built-in CORS, error handling, and health checks
  • 🐳 Docker Support - Ready-to-use Docker images with environment variable support
  • 📦 Easy Deployment - Deploy anywhere with comprehensive environment variable support
  • 🔌 Socket.IO Powered - Built on the reliable Socket.IO framework

🚀 Quick Start

NPM

# Install the package
npm install sockster

# Create an .env file
echo "SOCKSTER_PORT=4000\nSOCKSTER_ORIGIN_URL=http://localhost:3000" > .env

# Start the server
npx sockster

Docker

# Pull and run
docker run -p 4000:4000 -e SOCKSTER_ORIGIN_URL=http://localhost:3000 djurnamn/sockster

Docker Compose

services:
  sockster:
    image: djurnamn/sockster:latest
    ports:
      - "${SOCKSTER_PORT:-4000}:4000"
    environment:
      - SOCKSTER_PORT=4000
      - SOCKSTER_ORIGIN_URL=http://localhost:3000

🔌 Client Connection

Connect from your frontend application (JavaScript/TypeScript):

import { io } from "socket.io-client";

const socket = io("http://localhost:4000");

// Listen for connection
socket.on("connect", () => {
  console.log("Connected to sockster! 🎉");
});

// Send an event
socket.emit("my-event", { data: "Hello!" });

// Listen for events
socket.on("my-event", (data) => {
  console.log("Received:", data);
});

🌍 Production Deployment

Railway (Recommended)

  1. Install Railway CLI:

    npm i -g @railway/cli
  2. Deploy to Railway:

    railway login
    railway init
    railway up
  3. Set environment variables:

    railway variables add SOCKSTER_ORIGIN_URL=https://your-frontend-app.com
  4. Get your WebSocket URL:

    railway domain
  5. Update your client configuration:

    const socket = io("wss://your-app-name.railway.app");

⚙️ Environment Variables

| Variable | Description | Default | |---------------------|---------------------------------------|-------------| | SOCKSTER_PORT | Port to run the server on | 4000 | | SOCKSTER_ORIGIN_URL | Allowed CORS origin | - |

🛠️ Development

# Clone the repository
git clone https://github.com/djurnamn/sockster.git

# Install dependencies
pnpm install

# Start the server
pnpm start

🤝 Contributing

Contributions are welcome! Feel free to:

  • 🐛 Report bugs
  • 💡 Suggest features
  • 🔧 Submit pull requests

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

Built with:

  • Socket.IO - Reliable real-time framework
  • dotenv - Environment variable management

🌟 Star Us!

If you find sockster helpful, please consider giving it a star ⭐️ It helps others discover the project!