JSONBird is a Duplex stream for JSON-RPC 2.0 client/server/peer communication over any reliable transport, including WebSocket, TCP, HTTP, Web Workers, and in-process. Version 3.1.0 is stable with npm release cadence. It supports both out-of-order messaging and in-order byte streams, object mode for structured clone, and flexible readable/writable modes (json-message, json-stream, object). Unlike alternatives, it provides a single unified interface for client, server, or bidirectional use, with minimal dependencies and no transport coupling.
npm install jsonbirdNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows creating two JSONBird instances piped together for in-memory JSON-RPC, calling a registered method.
Use 'json-message' for message-based transports (e.g., WebSocket), 'json-stream' for stream-based (e.g., TCP), and 'object' for in-memory/structured clone.
Always attach a consumer: rpc.on('data', cb) or rpc.pipe(destination).Switch to ESM import syntax if using ES modules.
Instantiate the class first: rpc.methods(new MyClass())
Pass { receiveErrorStack: true, sendErrorStack: true } in options.Correct import: const JSONBird = require('jsonbird'); or import JSONBird from 'jsonbird';Run: npm install jsonbird
Ensure readableMode and writableMode are set appropriately for your transport. See documentation.
No dependency data recorded yet.