{"id":19016955,"url":"https://github.com/shivam010/protocol-buffer-to-typescript-plugin","last_synced_at":"2025-04-23T02:47:11.119Z","repository":{"id":103979336,"uuid":"136709885","full_name":"Shivam010/Protocol-Buffer-to-TypeScript-Plugin","owner":"Shivam010","description":"Protocol Buffer to TypeScript Plugin is the extension of the Protocol Compiler to compile the proto files into corresponding TypeScript code","archived":false,"fork":false,"pushed_at":"2019-04-10T23:28:05.000Z","size":58,"stargazers_count":9,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-23T02:47:04.472Z","etag":null,"topics":["angular","google","google-protobuf","google-protocol-buffers","protocol-buffers","python-plugin","typescript"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Shivam010.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-06-09T09:35:19.000Z","updated_at":"2021-01-31T13:04:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"5ad5b4d8-7761-4b9f-936a-e1d902082249","html_url":"https://github.com/Shivam010/Protocol-Buffer-to-TypeScript-Plugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shivam010%2FProtocol-Buffer-to-TypeScript-Plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shivam010%2FProtocol-Buffer-to-TypeScript-Plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shivam010%2FProtocol-Buffer-to-TypeScript-Plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shivam010%2FProtocol-Buffer-to-TypeScript-Plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Shivam010","download_url":"https://codeload.github.com/Shivam010/Protocol-Buffer-to-TypeScript-Plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250360251,"owners_count":21417717,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","google","google-protobuf","google-protocol-buffers","protocol-buffers","python-plugin","typescript"],"created_at":"2024-11-08T19:45:20.794Z","updated_at":"2025-04-23T02:47:11.100Z","avatar_url":"https://github.com/Shivam010.png","language":"Python","readme":"[![Build Status](https://travis-ci.org/Shivam010/Protocol-Buffer-to-TypeScript-Plugin.svg?branch=master)](https://travis-ci.org/Shivam010/Protocol-Buffer-to-TypeScript-Plugin)\n\nProtocol Buffer to TypeScript Plugin\n====================================\nProtocol Buffer is copyright with Google Inc. https://developers.google.com/protocol-buffers/\n\nProtocol Buffer to TypeScript Plugin is the extension of the Protocol Compiler to compile the proto files into corresponding TypeScript code.\n\nOverview\n========\n\nProtocol Buffers (a.k.a., protobuf) are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data. You can find [protobuf's documentation on the Google Developers site](https://developers.google.com/protocol-buffers/).\n\nThis repository contains the TypeScript extension that implements Protocol Buffers functionality in TypeScript.\n\nConsider file test.proto, \n\n```proto\n    syntax = \"proto3\";\n\n    package test;\n\n    message Msg{\n    string name = 1;\n    }\n```\n\nCompiling the file into TypeScript code, \n\n```typescript\n    import { Observable } from 'rxjs';\n\n    export interface Msg {\n        name: string;\n    }\n```\n\nInstallations\n=============\n\n1) Make sure you have Python 2.x.  If in doubt, run:\n       \n       $ python -V\n\n2) If you don't have the protocol compiler, `protoc` installed, install a binary distribution of `protoc`, and the simplest way to install it is to download a [pre-built binary](https://github.com/google/protobuf/releases).\n        \n        $ protoc --version\n\n3) Download or clone the [Python Protocol Buffers runtime library](https://github.com/google/protobuf/tree/master/python)\n\n4) Build and run the tests:\n\n       $ python setup.py build\n       $ python setup.py test\n\n5) And Install:\n\n       $ python setup.py install\n\n6) Now, clone our plugin and you are all done.\n\nSetup and Run\n=============\n\nFor Windows\n\n1) Set the interpreter to the plugin by adding your Python 2.x path 'C:\\Python27\\python.exe' in the begining of the `tsPlugin.py` file\n\t`#!C:\\Python27\\python.exe`\n\n2) Now, edit the `runPlugin.bat` file to make the python file executable.\n\n3) Now, generate your TypeScript code using,\n\n       $ protoc -I \u003cProject_Path\u003e -I \u003cProto_File_Directory_Path\u003e \u003cProto_Files_Path\u003e --plugin=protoc-gen-custom=\u003cExecutable_File_Path\u003e --custom_out=\u003cOutput_Directory_Path\u003e\n       \n    Like:\n\n       $ pwd\n       ..\\protobuf-to-typescript\n       $ protoc -I . -I examples\\test examples\\test\\test.proto --plugin=protoc-gen-custom=runPlugin.bat --custom_out=examples\\output`\n\nFow Linux\n\n1) Set the interpreter to the plugin by adding your Python 2.x path '/usr/bin/env python' in the begining of the `tsPlugin.py` file\n    `#!/usr/bin/env python`\n\n2) Now, generate your TypeScript code using,\n\n       $ protoc -I \u003cProject_Path\u003e -I \u003cProto_File_Directory_Path\u003e \u003cProto_Files_Path\u003e --plugin=protoc-gen-custom=\u003cPlugin_Path\u003e --custom_out=\u003cOutput_Directory_Path\u003e\n\n    Like:\n\n       $ protoc -I . -I examples\\test examples/test/test.proto --plugin=protoc-gen-custom=tsPlugin.py --custom_out=examples/output\n\n    or \n\n    Use the `generator.sh` script to compile all the proto files in a directory\n\nContributing\n============\nChanges and improvements are more than welcome! \nFeel free to fork and open a pull request. \nAnd Please make your changes in a specific branch and request to pull into master! If you can, please make sure the game fully works before sending the PR, as that will help speed up the process.\n\nLicense\n=======\nProtocol Buffer to TypeScript Plugin is licensed under the [MIT license](https://github.com/Shivam010/Protocol-Buffer-to-TypeScript-Plugin/blob/master/LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshivam010%2Fprotocol-buffer-to-typescript-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshivam010%2Fprotocol-buffer-to-typescript-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshivam010%2Fprotocol-buffer-to-typescript-plugin/lists"}