0.1.1 • Published 2 years ago

hobby-rpc v0.1.1

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

It is a Hobby-RPC client for browsers, using the built-in Fetch API. To install:

npm i hobby-rpc

A usage example:

import { RPC } from 'hobby-rpc'

rpc = RPC
  url: 'https://some.domain'
  token: 'the bearer token'

output = await rpc 'SomeNullaryFunction'
output = await rpc 'SomeUnaryFunction', input

input can be any object serializable to JSON (that's what will be passed to the remote function as an argument). The remote server at https://some.domain is expected to implement SomeNullaryFunction and SomeUnaryFunction.

output would be an object deserialized from JSON.

0.1.0

2 years ago

0.1.1

2 years ago

0.0.1

3 years ago

0.0.0

3 years ago