{"name":"protocol-buffers-schema","version":"3.6.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":"46c34bd3199aa1e32374a1af59d02413b9ea197a","_id":"protocol-buffers-schema@3.6.1","_nodeVersion":"24.13.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-VG2K63Igkiv9p76tk1lilczEK1cT+kCjKtkdhw1dQZV3k3IXJbd3o6Ho8b9zJZaHSnT2hKe4I+ObmX9w6m5SmQ==","shasum":"fd9a58a5c4e96385b964808f3ddd58f9ef18c3c8","tarball":"http://registry-npm.ywwl.com/protocol-buffers-schema/download/protocol-buffers-schema-3.6.1.tgz","fileCount":44,"unpackedSize":68888,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGgavcTGBLdsWGNZxk2ToAUJAt0RI/acXnTUG9PX8ZiFAiAaavNVi8+dSQ732F9nQtke6RGFVmrZXaKt9NP8WJsDnw=="}],"size":13572,"noattachment":false,"key":"/protocol-buffers-schema/-/protocol-buffers-schema-3.6.1.tgz"},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/protocol-buffers-schema_3.6.1_1775502374629_0.3964919118476944"},"_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":1775502374811,"_cnpm_publish_time":1775502374811,"dist-tags":{"latest":"3.6.1"}}