{"name":"protocol-buffers-schema","version":"3.4.0","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":"09eccf906c0a88f733852e2b7dd8aeef9a6a0321","_id":"protocol-buffers-schema@3.4.0","_nodeVersion":"12.14.1","_npmVersion":"6.13.4","dist":{"integrity":"sha512-G/2kcamPF2S49W5yaMGdIpkG6+5wZF0fzBteLKgEHjbNzqjZQ85aAs1iJGto31EJaSTkNvHs5IXuHSaTLWBAiA==","shasum":"2f0ea31ca96627d680bf2fefae7ebfa2b6453eae","tarball":"http://registry-npm.ywwl.com/protocol-buffers-schema/download/protocol-buffers-schema-3.4.0.tgz","fileCount":42,"unpackedSize":63131,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeKs20CRA9TVsSAnZWagAAOOYQAJTICZktdxBUtdJ75YRV\n2dPjYav+wLWNmszeprU7byvuGtK1zl5q3HFQoL+saZjCUHJhbeYWoBlx+Ndh\ntozzPl0vQZ7VD+NdW1qNyRHrKKNzecQ7fCaubn3i1+KhqgZN4Lnb9g1iMhPm\njM9JPvK2eg5bAzTi18c2aTz+2UvRXi1sFtzDycLzSi+lLrmhZyWDtZGcMm+5\nDjTS6XzpfZz99OYzk4VeUt+A5uSPmdkuT/hM7Pg90nj35BBj1C9BwxoN2XL7\nVvZ4y4V9zWxsq8jN1dFLRsKrguXHkMRo+pLlLcMmfcyFdCLYepNB0InzZLcm\nWmeJkYXxoIKvauoxZZOqDyq2KFvWwhUZqryJD3XjYw/Uf43xW33kZ0pZ4KrW\nrfj3yGpf1m/OCuyzkZ30xnuPFI/6bIQHlf8dhZJX1Sqi9eNKsQLQa+VwJb9f\ndz1IxtFPL76Kb+Wp2WMluoEk6g97ylIqRZ8dm0waZmaZ7z7xLaM44HXKgmh3\nUgmsgLZAArIZOJQ00DUjKn6anJRejB1il6lhQrYpYpxmtV4Fjpyevjy+JoW7\nQPS/wiCAYBN/Ua2W5CTzR5XtjhNGjwCRCq0kkDTpB0G4BkI/obNYnhr3J4CV\n8YlrTttGRX8mb5omUIA3X4GnbC/fp2Z+iZAHkfl01PWPKK7UnOqA941IbXOz\nxjx6\r\n=EQe9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFW106Jk3rmPRYkiMDwXQ1UuoANaJPpy5B93ZdrIbQ4LAiEAp0m0ILN7W99kwI6ARPGv4C1lXwnO5gNfhygQzuXngdM="}],"size":12829,"noattachment":false,"key":"/protocol-buffers-schema/-/protocol-buffers-schema-3.4.0.tgz"},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/protocol-buffers-schema_3.4.0_1579863476186_0.7917144936755129"},"_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":1579863476329,"_cnpm_publish_time":1579863476329,"dist-tags":{"latest":"3.6.1"}}