protobufjs-patch
v1.0.5
Published
patch protobufjs for doc
Downloads
0
Readme
protobufjs-patch
patch protobufjs for doc
- let protobufjs to gen doc for proto file like golang
- fix protobufjs cli bug (https://github.com/protobufjs/protobuf.js/issues/1383)
Usage
If protobufjs is not found in the project, the global node_modules is auto checked
- global
pbpatch --tags tag1 tag2
# or use: node your/project/path/node_modules/.bin/pbpatch --tags tag1 tag2
# use protobufjs build *.proto
- module
import pbpatch from 'protobufjs-patch'
const customTags=['tag1','tag2']
pbpatch(customTags)
// use protobufjs build *.proto
在使用该模块的项目中,编译*.proto文件命令参考
# 先修改protobufjs模块,再编译*.proto文件
node node_modules/.bin/pbpatch
pbBin=node_modules/protobufjs-patch/node_modules/protobufjs/bin
# --alternate-comment-mode 开启'//','/**/'注释
$pbBin/pbjs --no-create --no-verify --no-convert --no-delimited --force-long \
--alternate-comment-mode -t static-module -w es6 \
-p proto/file/path \
-o output.js input.proto
$pbBin/pbts -o output.d.ts output.js