0.2.1 • Published 7 months ago

jomiel-messages v0.2.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
7 months ago

jomiel-messages-js

npm-package code-style

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.

Acknowledgements

Subprojects (git-subtree)

0.2.1

7 months ago

0.2.0

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago