Registry / devops / siokit

siokit

JSON →
library0.1.5jsnpmunverified

Socket.IO-compatible server & client library written in TypeScript, supporting Engine.IO v4 (WebSocket and HTTP long-polling) and Socket.IO protocol with typed events, namespaces, acknowledgements, and binary attachments. Current stable version is 0.1.5 with moderate release cadence. Key differentiators: runtime-agnostic (Bun, Hono, Node.js via adapters), zero runtime dependencies beyond its own sub-packages (siokit-core, siokit-parser), and full TypeScript types. Unlike official Socket.IO, siokit is lightweight and adapter-based, making it suitable for serverless and edge environments.

npm install siokit
INSTALL
IMPORT
SIG · SIOKIT
S
siokit
devopsjavascriptv0.1.5
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.

newServer
import { newServer } from 'siokit'
const { newServer } = require('siokit')
siokit is ESM-only. Do not use require().
newSocket
import { newSocket } from 'siokit-client'
import { newSocket } from 'siokit'
The client socket factory is exported from 'siokit-client', not from 'siokit'.
encode/decode (siokit-parser)
import { encode, decode } from 'siokit-parser'
import { encode, decode } from 'siokit'
Parser utilities are in a separate package.
typenames
import { Event, Namespace } from 'siokit-core'
Core types are in 'siokit-core' package.

Demonstrates setting up a siokit server with Engine.IO + Socket.IO on Bun, and a client that connects, sends a named event, and receives a reply.

import { newServer } from 'siokit' import { newSocket } from 'siokit-client' import { serve } from 'bun' const app = newServer() app.on('connection', (socket) => { socket.on('hello', () => { socket.emit('reply', 'world') }) }) serve({ port: 3000, fetch(req, srv) { if (srv.upgrade(req)) return return app.fetch(req) }, websocket: app.websocket, }) const socket = newSocket('http://localhost:3000') socket.on('connect', () => { socket.emit('hello') socket.on('reply', (msg) => console.log(msg)) })
Debug
Known issues
gotchasiokit is in early development (v0.1.x). APIs may change without major version bump.
fix
Pin to exact version and regularly check changelog.
affects: <1.0.0
gotchaThe server package 'siokit' does not include a client. You must install 'siokit-client' separately.
fix
Add 'siokit-client' as a dependency if you need client functionality.
affects: >=0.1.0
breakingBreaking changes may occur between minor versions before 1.0.
fix
Use semver ranges like ^0.1.0 cautiously.
affects: <1.0
gotchaThe sub-packages siokit-core and siokit-parser are automatically installed when you install siokit, but may need explicit import for certain types.
fix
Add 'siokit-core' and 'siokit-parser' to dependencies if you import them directly.
affects: >=0.1.0
deprecatedNone currently.
affects: 0.1.x
Errors
Common errors & fixes
Error: Cannot find module 'siokit-client'
Client package not installed.
fix
Run 'npm install siokit-client'
TypeError: app.fetch is not a function
Using default export instead of named import for newServer.
fix
Use 'import { newServer } from 'siokit'' instead of 'import siokit from 'siokit''.
Error: The module 'siokit' does not provide a 'newSocket' export
Importing client factory from wrong package.
fix
Import 'newSocket' from 'siokit-client'.
TypeError: decode is not a function
Importing decode from 'siokit' instead of 'siokit-parser'.
fix
Import { decode } from 'siokit-parser'.
Upgrade
Version history
0.1.5latest on npm
Audit
Dependencies
siokit-corerequiredProvides generic types, event bus, and shared primitives used by the server and client packages.
siokit-parserrequiredEncodes/decodes Socket.IO protocol packets, including binary attachments.
Agent activity
9 hits · last 30 days
node
8
Amazon
1
Resources
packagesiokit
siokit — npm install siokit · libregistry