@tdxvolt/volt-client-grpc
v0.18.6
Published
tdx Volt library for nodejs clients
Downloads
94
Readme
@tdxvolt/volt-client-grpc
Javascript client library for accessing Volts using gRPC.
n.b. This is nodejs only - for browser support use @tdxvolt/volt-client-web
.
Installation
npm install @tdxvolt/volt-client-grpc
Usage
import grpc from "@grpc/grpc-js";
import { VoltClient } from "@tdxvolt/volt-client-grpc";
const configPath = "./volt.config.json";
let client = new VoltClient(grpc);
client
.initialise(configPath)
.then(() => {
return client.GetResourceDescendants({
resource_id: client.config.volt.id,
depth: 1
});
})
.then((response) => {
console.log(response);
})
.catch((err) => {
console.error("failure in simple-client [%s]", err.message);
})
.finally(() => {
console.log("finished");
});