jomiel-messages-js
The javascript bindings for the jomiel protobuf messages.
- Easy to install jomiel protobuf message bindings for js
- Generated from the jomiel-proto declarations
Installation
npm install jomiel-messages
Usage
Serialize an inquiry message:
import jomielMessages from "jomiel-messages";
const { Inquiry } = jomielMessages.jomiel.protobuf.v1beta1;
const uri = "https://...";
const msg = Inquiry.create({ media: { inputUri: uri } });
const bytes = Inquiry.encode(msg).finish();
// ...
Deserialize the response message:
const { Response, StatusCode } = jomielMessages.jomiel.protobuf.v1beta1;
// bytes: data read from the zeromq socket (returned by jomiel)
const msg = Response.decode(bytes);
if (msg.status.code !== StatusCode.STATUS_CODE_OK) {
const status = msg.status;
// ...
}
License
jomiel-messages
is licensed under the Apache License version
2.0.