2.4.3 • Published 5 years ago

json-to-protobuf-definition v2.4.3

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

Convert JSON to Protocol Buffer definition

npm version CI codecov dependencies Status devDependencies Status Maintainability

{
  "name": "Mo Kweon",
  "some_property": 1234
}

to

message Root {
  string name = 1;
  int64 some_property = 2;
}

Install

npm install -D json-to-protobuf-definition
yarn add -D json-to-protobuf-definition

How to use

import {
  convertProtoMessageToString,
  parseRootObjectToProtoMessage,
} from "json-to-protobuf-definition";

// obtained from JSON.parse('{"name": "Mark Hahn""}')
const input = {
  name: "Mark Hahn",
};

const message = parseRootObjectToProtoMessage(input);
console.log(convertProtoMessageToString(message));
// message Root {
//   string name = 1;
// }

How to develop

yarn # install dependencies
yarn test # run test
yarn lint # run lint or `yarn lint --fix` to fix the lint issues
2.4.1

5 years ago

2.4.3

5 years ago

2.4.2

5 years ago

2.3.0

5 years ago

2.2.0

5 years ago

2.4.0

5 years ago

2.3.1

5 years ago

2.1.1

5 years ago

1.0.10

5 years ago

2.1.0

5 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.2

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.1

6 years ago