protobufjs load from string

1.9k views Asked by At

I get a .proto definition as a string input, can I load it into a Root object straight from the string, for example the string might look like this

let protoStr = `syntax = "proto3";

message SearchRequest {
  string query = 1;
  int32 page_number = 2;
  int32 result_per_page = 3;
}`

And I want to be able to load it

let searchRequest = protobuf.loadFromStr(protoStr)
1

There are 1 answers

0
ARIF MAHMUD RANA On BEST ANSWER