protobufjs-patch

1.0.5 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i protobufjs-patch

Weekly Downloads

0

Version

1.0.5

License

MIT

Unpacked Size

18.2 kB

Total Files

9

Last publish

Collaborators

  • yangjunnpmjs