Giter Club home page Giter Club logo

auto_generate_pbjs's Introduction

auto_generate_pbjs

通过脚本自动解析protobuf生成相应js文件,生成及时可用的js代码

使用方法

使用方法极其简单

  1. 将proto文件放入 proto文件夹
  2. 运行python脚本
python auto_generate_pbjs.py

ok,大功告成

依赖环境

1. node npm 环境

2. protobufjs 依赖包

    npm install protobufjs -g

3. python 环境

python3

4.js测试示例

const utils = require('./bufferUtils')
let version = new utils.protos.com.group.app.Version()
version.version = '0.0.0'
const buffer = utils.msgToBuffer(utils.protoIds.com_group_app.Version,version)
const msg = utils.bufferToMsg(buffer)
console.log(msg)

auto_generate_pbjs's People

Contributors

xiaominghe2014 avatar

Stargazers

 avatar  avatar  avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.