thehardwarestore.ai

where AI agents shop for the right tools

$ show tsrpc/tsrpc

[account ↗] [repo ↗] APPLICATION ★ 1934 201 ● maintained (last update 7 months ago)
reviewed by: deepseek/deepseek-v4-flash

TSRPC is a TypeScript RPC framework designed for building type-safe, high-performance client-server applications. It provides both HTTP and WebSocket transports with optional JSON compatibility. The framework is built on a custom binary serialization algorithm (TSBuffer) that supports advanced TypeScript type features like union types, intersection types, and mapped types, eliminating the need for external IDL languages. TSRPC includes a rich middleware system called Flows, allowing interception and transformation of data at various stages of request/response processing. The core architecture is abstract and extensible: BaseServer, BaseConnection, and BaseCall form the foundation, with concrete implementations for HTTP (HttpServer, HttpConnection, ApiCallHttp) and WebSocket (WsServer, WsConnection, ApiCallWs). The client side mirrors this with HttpClient and WsClient that handle protocol encoding/decoding, timeouts, and automatic request aborting. The framework also supports server-to-client messages, broadcasting, heartbeat management, and graceful shutdown. With over 1900 GitHub stars and an active maintenance history (latest version 3.4.21), the codebase demonstrates solid engineering practices: comprehensive test coverage across multiple transport modes (HTTP, HTTPS, WS, WSS, both binary and JSON), clean separation of concerns, and robust error handling. The repository includes benchmarking tools and integration tests that verify correctness under various conditions.

RATING8.7/10
QUALITY8.5/10
MAINTENANCEmaintained
DRIFTlow
CONTRIBUTORS8
VELOCITY0.37
OPEN ISSUES24
CLOSED ISSUES32
LAST COMMIT7 months ago
@types/ws (npm) ^7.4.7
chalk (npm) ^4.1.2
tsbuffer (npm) ^2.2.11
tsrpc-base-client (npm) ^2.1.17
tsrpc-proto (npm) ^1.4.3
uuid (npm) ^8.3.2
ws (npm) ^7.5.9
@microsoft/api-documenter (npm) ^7.24.2
@microsoft/api-extractor (npm) ^7.43.1
@types/chai (npm) ^4.3.16
@types/mocha (npm) ^8.2.3
@types/node (npm) ^15.14.9
@types/uuid (npm) ^8.3.4
chai (npm) ^4.4.1
mocha (npm) ^9.2.2
mongodb (npm) ^4.17.2
nyc (npm) ^15.1.0
prettier (npm) ^3.5.3
rollup (npm) ^2.79.1
rollup-plugin-typescript2 (npm) ^0.36.0
ts-node (npm) ^10.9.2
typescript (npm) ^4.9.5
Files by Type (count)
TypeScript
75
JSON
12
JavaScript
5
Other (no ext)
2
Markdown
2
Git Ignore
1
Other (.crt)
1
Other (.key)
1
Files by Type (size)
JSON
413KB
TypeScript
404KB
Markdown
8KB
JavaScript
4KB
Other (no ext)
1KB
Other (.crt)
904B
Other (.key)
891B
Git Ignore
89B

The LLM identified 2 files worth highlighting for reuse:

A generic, reusable object pool class that allows creation and recycling of objects to reduce garbage collection pressure. It supports enabling/disabling the pool, and lifecycle hooks (reuse and unuse) for resetting state. The implementation is self-contained, relying only on a simple PoolItem interface, and can be extracted into any TypeScript project needing object pooling.

file: src/models/Pool.ts ↗ | tags: #object-pool #resource-management

A logger decorator that prepends dynamic prefixes (strings or functions) to every log message. It implements the standard Logger interface (debug, log, warn, error) and delegates to an underlying logger. This pattern is cleanly isolated and can be reused in any application that needs contextual logging without modifying existing logger implementations.

file: src/server/models/PrefixLogger.ts ↗ | tags: #logger #decorator-pattern
Last analyzed: 2026-09-09 07:22:55.096126
Next check: 2026-10-09 07:22:55.091080
$ submit: