Kkrpc

screenshot of Kkrpc
hono

A TypeScript RPC protocol for multiple environments (iframe, web worker, stdio, http, WebSocket)

Overview

The kkrpc library is a TypeScript-first Remote Procedure Call (RPC) tool designed to facilitate seamless communication between various environments such as Node.js, Deno, Bun, and browsers. Developed for the Tauri app ecosystem, kkrpc's versatility allows it to serve as a standalone package for various applications, enabling a robust extension system. With its innovative approach to bi-directional communication, kkrpc not only simplifies function calling across different contexts but also emphasizes type safety and developer usability.

What sets kkrpc apart from other RPC libraries is its true cross-runtime compatibility paired with TypeScript's extensive capabilities. While many alternatives are limited to specific environments or require complex configurations, kkrpc rises above the challenges by offering flexible communication methods alongside a user-friendly experience.

Features

  • Cross-runtime: Works seamlessly across Node.js, Deno, Bun, browsers, and more, providing unmatched flexibility.
  • Type-safe: Delivers full TypeScript inference and IDE autocompletion support, enhancing developer efficiency.
  • Bidirectional: Both endpoints can expose and call functions simultaneously, allowing for more dynamic inter-process communication.
  • Property Access: Offers remote getters and setters using dot notation, making remote API interactions intuitive (e.g., await api.prop).
  • Error Preservation: Maintains complete error objects across RPC boundaries, which is crucial for debugging.
  • Multiple Transports: Supports various transport protocols including stdio, HTTP, WebSocket, and postMessage for diverse use cases.
  • Callback Support: Enables remote functions to accept callbacks, adding to its functional versatility.
  • Nested Calls: Facilitates deep method chaining (e.g., api.math.operations.calculate()), which can streamline complex operations.
  • Auto Serialization: Features intelligent JSON/superjson detection to handle data efficiently.
  • Zero Config: Requires no schema files or code generation, simplifying setup and deployment.
  • Transferable Objects: Utilizes zero-copy transfers for large data, boosting performance significantly (40-100x faster).
hono
Hono

Hono is an ultrafast web framework designed for edge computing environments. It's lightweight, supports multiple runtimes including Cloudflare Workers, Deno, and Bun, and provides a familiar Express-like API with excellent TypeScript support.

typescript
Typescript

TypeScript is a superset of JavaScript, providing optional static typing, classes, interfaces, and other features that help developers write more maintainable and scalable code. TypeScript's static typing system can catch errors at compile-time, making it easier to build and maintain large applications.