https://github.com/bowmans-dev/protobuf_vs_json
https://github.com/bowmans-dev/protobuf_vs_json
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/bowmans-dev/protobuf_vs_json
- Owner: bowmans-dev
- Created: 2022-12-14T05:22:13.000Z (over 3 years ago)
- Default Branch: library
- Last Pushed: 2023-01-06T23:46:52.000Z (over 3 years ago)
- Last Synced: 2025-02-09T23:14:25.959Z (over 1 year ago)
- Language: JavaScript
- Size: 302 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### Protocol Buffers Crash Course https://www.youtube.com/watch?v=46O73On0gyI
Hussein Nasser [ https://github.com/hnasr ]
### Protocol Buffers (Protobuf) is a method of serializing structured data,
### - useful for storing it on disk or sending over the wire.
### **Benefits of ProtoBuf**
##### Schema
##### Binary compact size
##### Language neutral
### **Cons**
##### Have to have structured data (barrier to entry)
##### More involved processed for small applications.
##### Have to make sure to update compiled boilerplate code (bugs, security vulnerability, etc.)
##### hard to use with JSON based application (Javascript/browser)
### To run (using npm):
### use either:
```
npm start
```
#### or
```
node demoJson
```
- will create a JSON file
### To test protocol buffer implementation:
```
npm install google-protobuf
```
### ProtoC compiler download **[select the latest compiler for your operating system]**
- https://github.com/protocolbuffers/pr...
### Optional:
### vscode-proto3 (Protobuf 3 support if your running in Visual Studio Code)
### Pre-fix following terminal command with location of your protoc download:
```
/protoc-3.19.1-osx-x86_64/bin/protoc --js_out=import_style=commonjs,binary:. employees.proto
```
### To run protocol buffer implementation:
```
node demoProtobuf
```
- will create a binary file
### run `ls -lh` in your directory - compare file sizes
### Resources
### protocol buffer javascript doc
https://github.com/protocolbuffers/pr...
### Source Code
https://github.com/hnasr/javascript_p...