1.0.5 • Published 4 years ago

protobufjs-patch v1.0.5

Weekly downloads
1
License
MIT
Repository
-
Last release
4 years ago

protobufjs-patch

patch protobufjs for doc

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