pb-to-typescript
v1.0.2
Published
<a href="https://github.com/brandonxiang/pb-to-typescript/blob/master/LICENSE"> <img src="https://img.shields.io/github/license/brandonxiang/pb-to-typescript" alt="license"> </a>
Downloads
6
Readme
pb-to-typescript
Intro
A converter to transform from Protobuf to Typescript definition files, which is inspired by geotho/protobuf-to-typescript. However, this converter is powered by protobuf.js, which is more tend to regularity and principle.
Protobuf is currently used in micro-service for back end. As a front end web developer, you can generate Typescript defination files based on Protobuf in case to develop your web page easily.
Usage
import { parseProto } from 'pb-to-typescript';
const source = `
syntax = "proto3";
message MyRequest {
string path = 1;
}
`;
const ts = parseProto(source);
The result is as follow.
interface MyRequest {
path: string;
}