@codenotary/immudb-node-pbjs
TypeScript icon, indicating that this package has built-in type declarations

2.0.0-alpha.0 • Public • Published

Generate protobufjs client for immudb .proto file

Prepare schema.proto after updates

It may be neccessery to repair synthax errors in actualized .proto file.

Following lines should be commented:

  • import "google/api/annotations.proto";
  • import "protoc-gen-swagger/options/annotations.proto";

Also:

  • ; semicolon after title: "immudb REST API"; should be removed
  • ; semicolon after info: { ... }; should be removed

Generate static code

To generate static protobuf code in file src/main.js:

npx pbjs --target static-module --force-long --es6 --wrap es6 --out src/main.js schema.proto

To use as a module and generate typedefinitions change second line on src/main.js to:

import $protobuf from "protobufjs/minimal.js";

Generate typescript definitions

To generate typescript type definitions in file src/main.d.ts:

npx pbts --out src/main.d.ts src/main.js

Alternatively (sometimes this works):

npx pbjs --target static-module --force-long --es6 --wrap es6 schema.proto | npx pbts -o src/main.d.ts -

Package Sidebar

Install

npm i @codenotary/immudb-node-pbjs

Weekly Downloads

5

Version

2.0.0-alpha.0

License

Apache-2.0

Unpacked Size

2.38 MB

Total Files

6

Last publish

Collaborators

  • tomekkolo
  • iamvs
  • senelalp
  • vchain