Giter Club home page Giter Club logo

protoc's Introduction

背景

  • 使用诉求。在前后端开发协作中,将用于协议编写的proto文档转换为ts的类型定义文件。
  • 使用痛点。公司内网或者并未翻墙的开发者,github存在无法访问或者访问速度很差的情况,https://www.npmjs.com/package/protoc,原有的protoc包大概率出现安装失败的情况。

改进点

  • 将支持的protoc版本从3.11.2升级到3.18.1
  • 使用本地包来代替从指定的github下载地址下载,避免网络问题导致安装失败。
  • 修复现有包对后续版本支持的问题。现有的包在对压缩包遍历时,只能支持单节点目录,假定所有的包里面只有bin目录,对于多目录压缩后的包,出现定位执行文件失败。

支持PB版本

  • 3.18.1

支持操作系统平台

  • darwin
  • linux
  • windows(在git bash下运行sh)

示例

var protoc = require("protoc");
 
protoc.library(["path/to/file.proto", "path/to/file2.proto"], function(err, files) {
  if (err) return console.error(err);
  // Handle the JavaScript Vinyl files.
  // These files can be used in Google Closure Compiler,
  // but they require the files in
  // https://github.com/google/protobuf/tree/master/js
  // ...
});

protoc's People

Contributors

superlc avatar

Stargazers

 avatar

Watchers

 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.