protobufjs-typescript-gen
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

protobufjs-typescript-gen

protobufjs-typescript-gen is a tool which used protocol buffers to generate a Typescript interface. The tool is currently highly opinionated in how it generates files. It internally uses protobuf.js.

protobuf.js is a pure JavaScript implementation with TypeScript support for node.js and the browser. It's easy to use, blazingly fast and works out of the box with .proto files!

Installation

node.js

$> npm install protobufjs-typescript-gen [--save --save-prefix=~]
// generate-protocol.js
const { generateProtocol } = require('protobufjs-typescript-gen');

generateProtocol({
    cwd: 'YOUR_PROTOCOL_DIRECTORY',
    outDir: 'YOUR_OUTPUT_DIRECTORY',
});
$> node generate-protocol.js

Example

Please see the examples folder for the structure of the generated interface.

Readme

Keywords

none

Package Sidebar

Install

npm i protobufjs-typescript-gen

Weekly Downloads

1

Version

1.0.5

License

MIT

Unpacked Size

31.9 kB

Total Files

21

Last publish

Collaborators

  • nikhilverma