Skip to content

php-skir/typescript-client

 
 

Repository files navigation

Skir TypeScript Client

Tests Coverage npm Node.js License

Library imported from TypeScript code generated from skir files.

Install with:

npm i @php-skir/skir-client

CBOR transport

The default SkirRPC transport stays compatible with upstream Skir. To exchange CBOR request and response bodies, opt in on both the client and service:

const client = new ServiceClient("https://example.com/rpc", undefined, {
  transportCodec: "cbor",
});

const service = new Service({ transportCodec: "cbor" });

CBOR transport sends a { method, request } envelope as application/cbor and encodes the response value as application/cbor.

When installing a CBOR-enabled service on Express, pass Express's raw middleware as the sixth argument:

installServiceOnExpressApp(app, "/rpc", service, text, json, raw);

See:

About

Runtime dependency for TypeScript code generated from .skir files

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages