1.0.5 • Published 2 years ago

protobufjs-typescript-gen v1.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

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.

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago