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

jconet-sockets

v1.0.7

Published

A custom WebSocket package inspired by Pusher

Readme

JCoNet Sockets

Build Status coverage report Latest Release

Description

JCoNet Sockets is a custom WebSocket package inspired by Pusher, providing an easy-to-use interface for real-time communication in web applications. It includes:

  • Host: A standalone WebSocket server.
  • Server-Side Client: For triggering events from your server-side code.
  • Client-Side Client: For subscribing to channels and receiving events in the browser or Node.js applications.

Installation

Use your preferred package manager to install jconet-sockets:

# If you are using npm:
npm install jconet-sockets

# If you are using pnpm:
pnpm add jconet-sockets

# If you are using yarn:
yarn add jconet-sockets

# If you are using bun:
bun add jconet-sockets

Usage

Host

Set up the WebSocket host server. This can run independently on a server.

import { Host } from "jconet-sockets";

// Start the WebSocket host on port 8080
const host = new Host(8080);

Server-Side Client

Use the server-side client to trigger events from your backend application (e.g., in API routes or server processes).

import { ServerClient } from "jconet-sockets";

// Connect to the WebSocket host
const serverClient = new ServerClient("ws://localhost:8080");

// Trigger an event on a channel
serverClient.trigger("my-channel", "new-event", { message: "Hello World!" });

Client-Side Client

Use the client-side client in your frontend application to subscribe to channels and listen for events.

import { Client } from "jconet-sockets";

// Your JWT token for authentication
const token = "YOUR_JWT_TOKEN";

// Connect to the WebSocket host
const client = new Client("ws://localhost:8080", token);

// Subscribe to a channel
const channel = client.subscribe("my-channel");

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

// Optionally, trigger events from the client
channel.trigger("client-event", { clientData: "Hello from client!" });

Generating JWT Tokens

On your server, generate JWT tokens for authenticating clients. This ensures secure communication and channel authorization.

import { generateToken } from "jconet-sockets";

// Generate a token for a user with access to specific channels
const token = generateToken("user-id", ["my-channel", "another-channel"]);

Development

If you want to contribute or run the package locally:

  1. Clone the repository:

    git clone https://gitlab.com/jconet-ltd/jconet-socket.git
  2. Install dependencies:

    pnpm install
  3. Run tests:

    pnpm test
  4. Build the package:

    pnpm build
  5. Run ESLint:

    pnpm lint

Contributing

Contributions are welcome and greatly appreciated! Please open an issue or submit a pull request on GitLab.

License

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

Contact

For questions or support, please contact Our Project Support Email.