1.0.2 • Published 5 years ago

pb-to-typescript v1.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

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;
}

Demo

Live Demo

License

MIT

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

6 years ago