Registry / messaging / stelar-time-real

stelar-time-real

JSON →
library2.0.4jsnpmunverified

A lightweight, dependency-free WebSocket library for real-time communication in TypeScript/JavaScript. Version 2.0.4 provides namespaces, ACKs, binary data support, and heartbeat detection with zero dependencies (only native WebSocket). Features a server and client API similar to socket.io but much smaller (~13MB heap). Designed for use with Express, Fastify, or native HTTP servers.

npm install stelar-time-real
INSTALL
IMPORT
SIG · STELAR-TIME-REAL
S
stelar-time-real
messagingjavascriptv2.0.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

StelarServer
✓ import { StelarServer } from 'stelar-time-real';
✗ import StelarServer from 'stelar-time-real';
Named export, not default. TypeScript types included.
StelarClient
✓ import { StelarClient } from 'stelar-time-real';
✗ const { StelarClient } = require('stelar-time-real');
ESM-only. CommonJS require will work but may cause issues with named exports.
default import
✓ import { StelarServer, StelarClient } from 'stelar-time-real';
✗ import Stelar from 'stelar-time-real';
No default export; all symbols named.

Shows basic server setup with Express and client connection. Express is optional; StelarServer works with any HTTP server or standalone.

import express from 'express'; import { StelarServer, StelarClient } from 'stelar-time-real'; const app = express(); const server = app.listen(3000); const stelar = new StelarServer({ server }); stelar.onConnection((client) => { console.log('New client:', client.id); client.emit('welcome', 'Hello! Welcome to stelar-time-real'); }); stelar.on('message', (ctx) => { ctx.broadcast('message', ctx.data); }); stelar.start(); // Client side const client = new StelarClient('localhost:3000'); client.connect(); client.on('welcome', (msg) => console.log(msg));
Debug
Known issues
breakingVersion 2.x drops CommonJS support. Use ESM imports.
fix
Change require() to import statements.
affects: >=2.0.0
gotchaConstructor expects options object; passing server directly will not work.
fix
Use 'new StelarServer({ server: yourServer })'
affects: >=1.0.0
deprecatedMethod 'getPort()' marked as deprecated in v2.0.0. Use 'server.address().port' instead.
fix
Replace stelar.getPort() with stelar.server.address().port
affects: >=2.0.0
Errors
Common errors & fixes
StelarServer is not a constructor
Importing default export instead of named export.
fix
Use '{ StelarServer }' in import statement.
Cannot find module 'stelar-time-real'
Package not installed or incorrect path.
fix
Run 'npm install stelar-time-real'
TypeError: Cannot read properties of undefined (reading 'emit')
Client not connected yet when calling emit.
fix
Ensure emit occurs after 'connect' event.
Upgrade
Version history
2.0.4latest on npm
Audit
Dependencies
wsoptionalNative WebSocket implementation used by both server and client (Web API in browsers, ws in Node.js)
Agent activity
16 hits · last 30 days
node
14
OpenAI (training)
1
Resources
stelar-time-real — npm install stelar-time-real · libregistry