{"name":"protocol-buffers-schema","version":"3.5.1","description":"No nonsense protocol buffers schema parser written in Javascript","main":"index.js","devDependencies":{"standard":"^10.0.3","tape":"^4.8.0"},"scripts":{"test":"standard && tape test/*.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/protocol-buffers-schema.git"},"keywords":["protobuf","protocol","buffers","schema","parser","parse"],"author":{"name":"Mathias Buus"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/protocol-buffers-schema/issues"},"homepage":"https://github.com/mafintosh/protocol-buffers-schema","gitHead":"5de5b217aaa7fcc4196422aed35b71b51bcc9102","_id":"protocol-buffers-schema@3.5.1","_nodeVersion":"14.15.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-YVCvdhxWNDP8/nJDyXLuM+UFsuPk4+1PB7WGPVDzm3HTHbzFLxQYeW2iZpS4mmnXrQJGBzt230t/BbEb7PrQaw==","shasum":"8388e768d383ac8cbea23e1280dfadb79f4122ad","tarball":"http://registry-npm.ywwl.com/protocol-buffers-schema/download/protocol-buffers-schema-3.5.1.tgz","fileCount":42,"unpackedSize":67078,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgBpp6CRA9TVsSAnZWagAAcA4P/2pmsbF4dc29VfbFBx5p\np0jHYMMTpuuJqVCbReTObdy/0Hxrcf/oYXQSRbXEpNvXpL7spRKmWkTCVovc\nAUfS2WPkfTYf4lwv2wEAwmyYkaLHCeAOIJvNEpBLgoP0xVSEdyv3Xw6n1Iw8\nHjzotM9Skf3B+sM5fn54MyeixJX77vfTX7gz+E6O7vi3fyUBiHBW5F2gtaTE\nU2xZNHBwBdDqZM5sqMg0NOnFSSCffY/1ZgP7D15O3M/XJ5VOHM6XXNy3tX/G\nXjxc/2he0fZuvT+8aT5VJ8O6rzd8d97dZDMTz4KLX/GgT7rIJJ7YpRxyL5Q5\nUPLDN9lMyhRapNm+tQik5eAqOrMgsLEH4jZpevlGsLy1kRImnw83/7UYOon9\nUkTj8/Cd91DRq+6xlOSLlt6vrExZnWWy6W1PLQZaoBJeCvE6fqryl/nlAxRw\nqTb9l2NGY30WPdtZY0mjPz3Xqbkw67jDGK4tLDS6n8kp0YSWRSlqQF0Rh32A\nqCFRDskpmWISqj2lZ7XWulUw+WgDctAVbbMq3nvBaTOuf2pvgAuGT7lggExN\n7ejZ1ETYJ2qoyQbav2LEDRKp88R+rOtR6f78CShThxCPSO2q48PP1StveHB7\niQ/lowQBl0HRAeBAf/Lgo5KTE0dK5+Rfw5qqXuTA3Wxq02RnSRm/TvLWRM4g\n6mOD\r\n=svaC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC81TPG6XWA1HP/kN7DoROEZibYXP440TXgIExMClGW+wIhAJ36sxB4nOkF7bIU+OSK+kK5DE8Z1nmBM3EZMMbVe2aA"}],"size":13564,"noattachment":false,"key":"/protocol-buffers-schema/-/protocol-buffers-schema-3.5.1.tgz"},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/protocol-buffers-schema_3.5.1_1611045498479_0.5575044804640978"},"_hasShrinkwrap":false,"readme":"# protocol-buffers-schema\n\nNo nonsense [protocol buffers](https://developers.google.com/protocol-buffers) schema parser written in Javascript\n\n``` js\nnpm install protocol-buffers-schema\n```\n\n[![build status](http://img.shields.io/travis/mafintosh/protocol-buffers-schema.svg?style=flat)](http://travis-ci.org/mafintosh/protocol-buffers-schema)\n\n## Usage\n\nFirst save the following file as `example.proto`\n\n```proto\nsyntax = \"proto2\";\n\nmessage Point {\n  required int32 x = 1;\n  required int32 y=2;\n  optional string label = 3;\n}\n\nmessage Line {\n  required Point start = 1;\n  required Point end = 2;\n  optional string label = 3;\n}\n```\n\nThe run the following example\n\n``` js\nvar fs = require('fs')\nvar schema = require('protocol-buffers-schema')\n\n// pass a buffer or string to schema.parse\nvar sch = schema.parse(fs.readFileSync('example.proto'))\n\n// will print out the schema as a javascript object\nconsole.log(sch)\n```\n\nRunning the above example will print something like\n\n``` js\n{\n  syntax: 2,\n  package: null,\n  enums: [],\n  messages: [{\n    name: 'Point',\n    enums: [],\n    messages: [],\n    options: {},\n    fields: [{\n      name: 'x',\n      type: 'int32',\n      tag: 1,\n      required: true,\n      repeated: false,\n      options: {}\n    }, {\n      name: 'y',\n      type: 'int32',\n      tag: 2,\n      required: true,\n      repeated: false,\n      options: {}\n    }, {\n      name: 'label',\n      type: 'string',\n      tag: 3,\n      required: false,\n      repeated: false,\n      options: {}\n    }]\n  }, {\n    name: 'Line',\n    enums: [],\n    messages: [],\n    options: {},\n    fields: [{\n      name: 'start',\n      type: 'Point',\n      tag: 1,\n      required: true,\n      repeated: false,\n      options: {}\n    }, {\n      name: 'end',\n      type: 'Point',\n      tag: 2,\n      required: true,\n      repeated: false,\n      options: {}\n    }, {\n      name: 'label',\n      type: 'string',\n      tag: 3,\n      required: false,\n      repeated: false,\n      options: {}\n    }]\n  }],\n  options:{}\n}\n```\n\n## API\n\n#### `schema.parse(protobufSchemaBufferOrString)`\n\nParses a .proto schema into a javascript object\n\n#### `schema.stringify(schema)`\n\nStringifies a parsed schema back into .proto format\n\n## License\n\nMIT\n","publish_time":1611045498645,"_cnpm_publish_time":1611045498645,"dist-tags":{"latest":"3.6.1"}}