proto-ast-compile
v1.0.3
Published
Compiles the ProtoDocument AST back into a proto doc.
Downloads
9
Readme
proto-ast-compile
Compiles the ProtoDocument AST back into a proto doc.
Usage
const {compile, unsafeCompile} = require("proto-ast-compile");
//unsafeCompile does not check for validity
const parser = require("proto-parser");
const protoDocument = parser.parse(protoString);
//...do some edits on protoDocument
const compiledProtoString = compile(protoDocument);
fs.writeFileSync("my-file.proto", compiledProtoString);
Currently only supports proto3 syntax
Known Restrictions
- No public imports - currently missing from proto-parser
- No reserved enums - currently missing from proto-parser