grpc-protobufjs-devtools
grpc, proto, protobufjs, devtools, chrome, extensions
Overview
What is grpc-protobufjs-devtools?
grpc, proto, protobufjs, devtools, chrome, extensions.
SCREENSHOT
SUMMARY
### use
1, 使用node和protobufjs创建proto.js。
``` javascript
const pbjs = require("protobufjs/cli/pbjs");
const fs = require('fs');
const path = require('path');
const glob = require('glob');
const protoPath = 'src/proto/**/*.proto'; // origin path
const protos = glob.sync(protoPath);
pbjs.main([ "--target", "json-module", "-w", "commonjs", ...protos], function(err, output) {
if (err)
throw err;
// target path
fs.writeFileSync(path.resolve(__dirname, './src/xxx/proto.js'), output);
});
```
2, 挂载json字符串到window。
``` javascript
const $root = require('./src/xxx/proto.js');
window.__DEVTOOLS_PROTO_JSON_STRING__ = JSON.stringify($root.toJSON({keepComments: true}));
```
See More
Stats
Trends for grpc-protobufjs-devtools:
Rank
User count
Category Rank
Rating
Download
HOW TO INSTALL grpc-protobufjs-devtools FROM A CRX FILE
- Download grpc-protobufjs-devtools CRX file
- NOTE: Sometimes the browser may block downloading / installing CRX file from outside the Chrome Web Store. If so, you may need to download the ZIP file instead
- In the URL bar, go to chrome://extensions
- Enable Developer mode
Ratings
USER REVIEWS (0)
No reviews