pb-to-typescript
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

pb-to-typescript

license

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

Readme

Keywords

none

Package Sidebar

Install

npm i pb-to-typescript

Weekly Downloads

2

Version

1.0.2

License

MIT

Unpacked Size

55.6 kB

Total Files

15

Last publish

Collaborators

  • brandonxiang