2.4.3 • Published 3 years ago
json-to-protobuf-definition v2.4.3
Convert JSON to Protocol Buffer definition
{
"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
3 years ago
2.4.3
3 years ago
2.4.2
3 years ago
2.3.0
3 years ago
2.2.0
3 years ago
2.4.0
3 years ago
2.3.1
3 years ago
2.1.1
3 years ago
1.0.10
3 years ago
2.1.0
3 years ago
1.0.9
4 years ago
1.0.8
4 years ago
1.0.7
4 years ago
1.0.6
4 years ago
1.0.5
4 years ago
1.0.2
4 years ago
1.0.4
4 years ago
1.0.3
4 years ago
1.0.1
4 years ago