Skip to content

RemObjRemote Objects Made Simple

Transparent RPC communication for JavaScript with full TypeScript support

Quick Example

typescript
// Provider side - expose your API
import { provide } from '@remobj/core'

const api = {
  greet: (name: string) => `Hello, ${name}!`,
  calculate: async (a: number, b: number) => {
    // Complex calculations can run in a worker
    return a + b
  }
}

provide(api, endpoint)
typescript
// Consumer side - use the remote API
import { consume } from '@remobj/core'

const remote = consume<typeof api>(endpoint)

// Call remote functions with full type safety
const greeting = await remote.greet('World')
const result = await remote.calculate(5, 3)

Why RemObj?

Traditional RPC libraries often require complex setup, protocol definitions, or lose type safety across boundaries. RemObj changes this by providing:

  • Simple API: Just two functions - provide() and consume()
  • Type Safety: Full TypeScript support with type inference
  • Performance: Minimal overhead with efficient serialization
  • Flexibility: Works with any message-passing interface
  • Memory Efficient: Automatic garbage collection of remote references

Use Cases

Web Workers

Offload CPU-intensive tasks without blocking the main thread

Microservices

Build distributed systems with type-safe communication

Electron Apps

Secure IPC between main and renderer processes

Browser Extensions

Communication between content scripts and background workers

Ready to Get Started?

Just want to try it out? Skip to the Quickstart.

Released under the MIT License.