jomiel-messages
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

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)

Package Sidebar

Install

npm i jomiel-messages

Weekly Downloads

0

Version

0.2.1

License

Apache-2.0

Unpacked Size

150 kB

Total Files

5

Last publish

Collaborators

  • guendto