{"name":"protocol-buffers-schema","version":"3.5.2","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":"76f815dad2aa4b5324e1eb789581190de3e199a8","_id":"protocol-buffers-schema@3.5.2","_nodeVersion":"16.1.0","_npmVersion":"6.14.13","dist":{"integrity":"sha512-LPzSaBYp/TcbuSlpGwqT5jR9kvJ3Zp5ic2N5c2ybx6XB/lSfEHq2D7ja8AgoxHoMD91wXFALJoXsvshKPuXyew==","shasum":"38ad35ba768607a5ed2375f8db4c2ecc5ea293c8","tarball":"http://registry-npm.ywwl.com/protocol-buffers-schema/download/protocol-buffers-schema-3.5.2.tgz","fileCount":42,"unpackedSize":67599,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhFBmcCRA9TVsSAnZWagAAZeYQAIjw537ge/4f0ks3jVoX\nKLdMlU003lfMAhC9cbrYPsnv7B1APVWzyaq0Or6xCSIsNfYQ7eYb5iLPS68m\nY5rook8uIwZIx6KgLF19yp+3OKBlPfiXSHZbZ5oO71xfxS4FJH0rAvZbRFa+\nL7S/SRhJ9mji102IyQtwA6mYl7NXsMdAgivq6UR5SXzVf6MiUE1QY6DdbDef\n3my/5HGa7EEjtrk0u3RVjocwoiXBpcoL3gznWlOAG3BTfTOXXcIhBtWJvKqD\nS71EXGubfCNhxwD0EIr9Z48yRoyeGnADoZ3yowNKZqg0VQ1/TJ2awX4Ge5pe\nPsMGxAaqUzSjUvLCqETNVI9+1cwEVoaXTqG9rrwTY8qS0E+/LACgQI4GIpZx\nyr2lb4TqyEs5r2S3alubHKREmNOPz7a0NCAurlwhTUshM73rPUgmPWCJMN7p\nH7l+9FWLc/06cFeMsmuPH4tqibca23pnp7PxZ95q1LjXMcqFE0QvKUe01H6T\nyzPLZOgjrrKiN/brtEiyAo4ZUOKIWg2FHKe0g772RYAqR3yCI7ESHF4KygFp\nMiVsqW4qVTwChzVEpmQwCVpihzIVu3RyCRVbWzroMRMr30v7aLq0hooDo6q9\nR1kHPDoygvbw+eIsGhNeImpoKIy9aQKDA63YsTgjmMA+kKKJDSNhrfpI3mlQ\nlAQQ\r\n=4Kcb\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCFwqFUoyzmlSAC4jU3PyCY6YwIjxJ01DyV/hNjz9dazQIgN28ZthXYoIyZ/lH7IqdnmsCMO9DJC+kXy8H2x95NT4U="}],"size":13628,"noattachment":false,"key":"/protocol-buffers-schema/-/protocol-buffers-schema-3.5.2.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.2_1628707228745_0.31514724369054803"},"_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":1628707228956,"_cnpm_publish_time":1628707228956,"dist-tags":{"latest":"3.6.1"}}