const protobuf = require('protobufjs'); const parseArgs = require('minimist'); function prettyJsonEncode(obj) { return JSON.stringify(obj, "", " "); } class PBTools { constructor() { this.csMsgIdPb = null; this.csProtoPb = null; this.ssMsgIdPb = null; this.ssProtoPb = null; this.mtPb = null; this.protoDir = './proto/'; } async init() { { this.csProtoPb = await (new protobuf.Root()).load( this.protoDir + 'cs_proto.proto', { 'keepCase': true } ); } { this.csMsgIdPb = await (new protobuf.Root()).load( this.protoDir + 'cs_msgid.proto', { 'keepCase': true } ); //this.cmMsgId = this.msgIdPb.lookup('CMMessageId_e'); //this.smMsgId = this.msgIdPb.lookup('SMMessageId_e'); } } } (new PBTools).init();