@porky-prince/protobuf

Protocol buffers for H5 game

Usage no npm install needed!

<script type="module">
  import porkyPrinceProtobuf from 'https://cdn.skypack.dev/@porky-prince/protobuf';
</script>

README

protobuf

Protocol buffers for H5 game

Reference

@egret/protobuf

Feature

  • protobuf.js, protobuf.d.ts and pbconfig.json will be added to your project automatically after the package was installed
  • support node >= 12

Install

Local

npm:

$ npm install --save @porky-prince/protobuf

yarn:

$ yarn add @porky-prince/protobuf

Global

npm:

$ npm install -g @porky-prince/protobuf

yarn:

$ yarn add global @porky-prince/protobuf

Usage

Using in code

const protobuf = require('@porky-prince/protobuf');

async function run() {
    await protobuf.add(projectRoot, true);
    await protobuf.generate(projectRoot);
}

Command line usage

First, you have to install the dependency package globally

$ porky-pb <command>

example:

$ porky-pb generate you-project-root

Command line options

  add [options] <projectRoot>       add protobuf.js, protobuf.d.ts and pbconfig.json to
                          your project
  generate <projectRoot>  generate bundle.js and bundle.d.ts to your project
                          by proto files
  help [command]          display help for command

License

MIT © PorkyKay