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

forktrix-chat

v1.0.0

Published

A lightweight real-time CLI chat application powered by Socket.io and PostgreSQL

Readme

Forktrix-Chat

A lightweight CLI real-time chat application powered by Node.js, Express, Socket.io, and PostgreSQL.


Overview

Forktrix-Chat provides a terminal-based messaging experience with room-based isolation and WebSocket communication. Rooms and bcrypt-hashed passwords are persisted in PostgreSQL, while live messages are broadcast directly to connected clients with low latency.


Features

  • Terminal-First User Interface: Interactive menus powered by inquirer.
  • Real-Time Messaging: Instant WebSocket communication via Socket.io.
  • Persistent Room Storage: Room credentials hashed with bcrypt and stored in PostgreSQL.
  • Ephemeral Message Delivery: Chat messages are broadcast in real time and not stored in the database.
  • Non-Disruptive Typing: Terminal input line is preserved when new messages arrive.
  • Single Command Execution: Install via npm or execute directly with npx.

Architecture

┌─────────────────────────┐          ┌──────────────────────┐          ┌────────────────┐
│   Terminal Client A     │◄────────►│                      │          │                │
│   (forktrix-chat CLI)   │  Socket  │   Node.js Server     │◄────────►│   PostgreSQL   │
└─────────────────────────┘   .io    │   (Express + Socket) │  pg lib  │   (rooms table)│
┌─────────────────────────┐  events  │                      │          │                │
│   Terminal Client B     │◄────────►│                      │          │                │
│   (forktrix-chat CLI)   │          └──────────────────────┘          └────────────────┘
└─────────────────────────┘

Project Structure

forktrix-chat/
├── bin/
│   └── forktrix-chat.js   # CLI entry point
├── src/
│   ├── config.js          # Resolves target server URL
│   ├── socket.js          # Socket.io client connection manager
│   ├── menu.js            # Interactive menus for creating and joining rooms
│   └── chat.js            # Terminal chat interface and message loop
├── server/
│   ├── db.js              # PostgreSQL connection pool and schema
│   └── index.js           # Server application and socket event listeners
├── package.json           # Package metadata and binary definitions
└── README.md

Quick Start

Run Instantly with npx

npx forktrix-chat

Install Globally

npm install -g forktrix-chat
forktrix-chat

Connecting to a Specific Server

forktrix-chat --server https://your-server.onrender.com

Development

1. Install Dependencies

npm install

2. Configure Environment

Create a .env file in the root directory:

DATABASE_URL=postgresql://user:password@host:port/dbname?sslmode=require
PORT=3000

3. Start Backend Server

npm run server

4. Run CLI Client Locally

npm start
# or
node bin/forktrix-chat.js

5. Run Test Suite

npm test

Socket.io Events

| Event | Direction | Payload | Description | |---|---|---|---| | list_rooms | Client to Server | None | Requests list of available rooms | | room_list | Server to Client | string[] | Returns array of room names | | create_room | Client to Server | { roomName, password, username } | Creates a room and joins user | | join_room | Client to Server | { roomName, password, username } | Validates password and joins user | | room_joined | Server to Client | { roomName, username } | Confirms successful entry into room | | user_joined | Server to Broadcast | { username } | Notifies participants of a new user | | send_message | Client to Server | { roomName, username, text } | Transmits chat message | | receive_message | Server to Broadcast | { username, text, timestamp } | Delivers message to room participants | | user_left | Server to Broadcast | { username } | Notifies participants when user disconnects | | error | Server to Client | { message } | Returns error message |