@quantumghost/twirp

0.1.1 • Public • Published

twirp rpc client for javascript.

This is a companion package to the twirp rpc system. It can generate javascript bindings, but this package is required for handling the differences between the nodejs binding and the browser binding.

The API exposed is identical each time:

const createTwirpClient = require("twirp-client");

const rpc = createTwirpClient(baseurl, serviceName, twirpVersion, useJSON, extraHeaders);

// The function returned has the signature below. "customHeaders" is optional, and if defined, will
// merge any custom headers into "extraHeaders" defined in the rpc client.
const resultPromise = rpc(methodName, inputProtobugMessageObject, outputProtobufMessageClass, customHeaders);

Credits

Readme

Keywords

none

Package Sidebar

Install

npm i @quantumghost/twirp

Weekly Downloads

1

Version

0.1.1

License

MIT

Unpacked Size

10.1 kB

Total Files

5

Last publish

Collaborators

  • quantumghost