{"name":"@grpc/proto-loader","version":"0.6.0-pre16","author":{"name":"Google Inc."},"contributors":[{"name":"Michael Lumish","email":"mlumish@google.com"}],"description":"gRPC utility library for loading .proto files","homepage":"https://grpc.io/","main":"build/src/index.js","typings":"build/src/index.d.ts","scripts":{"build":"npm run compile","clean":"node -e 'require(\"rimraf\")(\"./build\", () => {})'","compile":"tsc -p .","format":"clang-format -i -style=\"{Language: JavaScript, BasedOnStyle: Google, ColumnLimit: 80}\" src/*.ts test/*.ts","lint":"tslint -c node_modules/google-ts-style/tslint.json -p . -t codeFrame --type-check","prepare":"npm run compile","test":"gulp test","check":"gts check","fix":"gts fix","pretest":"npm run compile","posttest":"npm run check","generate-golden":"node ./build/bin/proto-loader-gen-types.js --keepCase --longs=String --enums=String --defaults --oneofs --json --includeComments -I deps/gapic-showcase/schema/ deps/googleapis/ -O ./golden-generated --grpcLib @grpc/grpc-js google/showcase/v1beta1/echo.proto","validate-golden":"rm -rf ./golden-generated-old && mv ./golden-generated/ ./golden-generated-old && npm run generate-golden && diff -r ./golden-generated ./golden-generated-old"},"repository":{"type":"git","url":"git+https://github.com/grpc/grpc-node.git"},"license":"Apache-2.0","bugs":{"url":"https://github.com/grpc/grpc-node/issues"},"bin":{"proto-loader-gen-types":"build/bin/proto-loader-gen-types.js"},"dependencies":{"@types/long":"^4.0.1","lodash.camelcase":"^4.3.0","long":"^4.0.0","protobufjs":"^6.10.0","yargs":"^15.3.1"},"devDependencies":{"@types/lodash.camelcase":"^4.3.4","@types/mkdirp":"^1.0.1","@types/mocha":"^5.2.7","@types/node":"^10.17.26","@types/yargs":"^15.0.5","clang-format":"^1.2.2","gts":"^1.1.0","rimraf":"^3.0.2","typescript":"~3.8.3"},"engines":{"node":">=6"},"readme":"# gRPC Protobuf Loader\n\nA utility package for loading `.proto` files for use with gRPC, using the latest Protobuf.js package.\nPlease refer to [protobuf.js' documentation](https://github.com/dcodeIO/protobuf.js/blob/master/README.md)\nto understands its features and limitations.\n\n## Installation\n\n```sh\nnpm install @grpc/proto-loader\n```\n\n## Usage\n\n```js\nconst protoLoader = require('@grpc/proto-loader');\nconst grpcLibrary = require('grpc');\n// OR\nconst grpcLibrary = require('@grpc/grpc-js');\n\nprotoLoader.load(protoFileName, options).then(packageDefinition => {\n  const packageObject = grpcLibrary.loadPackageDefinition(packageDefinition);\n});\n// OR\nconst packageDefinition = protoLoader.loadSync(protoFileName, options);\nconst packageObject = grpcLibrary.loadPackageDefinition(packageDefinition);\n```\n\nThe options parameter is an object that can have the following optional properties:\n\n| Field name | Valid values | Description\n|------------|--------------|------------\n| `keepCase` | `true` or `false` | Preserve field names. The default is to change them to camel case.\n| `longs` | `String` or `Number` | The type to use to represent `long` values. Defaults to a `Long` object type.\n| `enums` | `String` | The type to use to represent `enum` values. Defaults to the numeric value.\n| `bytes` | `Array` or `String` | The type to use to represent `bytes` values. Defaults to `Buffer`.\n| `defaults` | `true` or `false` | Set default values on output objects. Defaults to `false`.\n| `arrays` | `true` or `false` | Set empty arrays for missing array values even if `defaults` is `false` Defaults to `false`.\n| `objects` | `true` or `false` | Set empty objects for missing object values even if `defaults` is `false` Defaults to `false`.\n| `oneofs` | `true` or `false` | Set virtual oneof properties to the present field's name. Defaults to `false`.\n| `json` | `true` or `false` | Represent `Infinity` and `NaN` as strings in `float` fields, and automatically decode `google.protobuf.Any` values. Defaults to `false`\n| `includeDirs` | An array of strings | A list of search paths for imported `.proto` files.\n\nThe following options object closely approximates the existing behavior of `grpc.load`:\n\n```js\nconst options = {\n  keepCase: true,\n  longs: String,\n  enums: String,\n  defaults: true,\n  oneofs: true\n}\n```\n\n## Generating TypeScript types\n\nThe `proto-loader-gen-types` script distributed with this package can be used to generate TypeScript type information for the objects loaded at runtime. More information about how to use it can be found in [the *@grpc/proto-loader TypeScript Type Generator CLI Tool* proposal document](https://github.com/grpc/proposal/blob/master/L70-node-proto-loader-type-generator.md). The arguments mostly match the `load` function's options; the full usage information is as follows:\n\n```\nproto-loader-gen-types.js [options] filenames...\n\nOptions:\n  --help             Show help                                         [boolean]\n  --version          Show version number                               [boolean]\n  --keepCase         Preserve the case of field names                  [boolean]\n  --longs            The type that should be used to output 64 bit integer\n                     values. Can be String, Number                      [string]\n  --enums            The type that should be used to output enum fields. Can be\n                     String                                             [string]\n  --bytes            The type that should be used to output bytes fields. Can be\n                     String, Array                                      [string]\n  --defaults         Output default values for omitted fields          [boolean]\n  --arrays           Output default values for omitted repeated fields even if\n                     --defaults is not set                             [boolean]\n  --objects          Output default values for omitted message fields even if\n                     --defaults is not set                             [boolean]\n  --oneofs           Output virtual oneof fields set to the present field's name\n                                                                       [boolean]\n  --json             Represent Infinity and NaN as strings in float fields. Also\n                     decode google.protobuf.Any automatically          [boolean]\n  --includeComments  Generate doc comments from comments in the original files\n                                                                       [boolean]\n  --includeDirs, -I  Directories to search for included files            [array]\n  --outDir, -O       Directory in which to output files      [string] [required]\n  --grpcLib          The gRPC implementation library that these types will be\n                     used with                               [string] [required]\n```","readmeFilename":"README.md","_id":"@grpc/proto-loader@0.6.0-pre16","_nodeVersion":"12.18.3","_npmVersion":"6.14.6","dist":{"integrity":"sha512-defi9RVpDE7spHCN0EaiHC43vzdLWp9NM0HXkK+DI3k6XCpXxM8V7vvzFfaCPfM/TXj33JpB2ZTEtneIX6VudQ==","shasum":"981a6bc4c149131d0cbef4634888d0dc7cf6cd3e","tarball":"http://registry-npm.ywwl.com/@grpc/proto-loader/download/@grpc/proto-loader-0.6.0-pre16.tgz","fileCount":9,"unpackedSize":65934,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfkKoRCRA9TVsSAnZWagAAPZ8P/RGM19xrL1JWg3k93gsw\n8TpbvMs7Lwv9VKw9eYN990gTy+ndmXrfUVtHLFsKYqACQ761fIqUE306g0S9\nMEFWqcP1bsLr+OUqqIoV5H1Q0/cvVPgSUoT7Was0hD5I7xN+StXpxcnMa/wu\nNLb5JAq8XIdqPoQdpUg5heK31sM+FCnSWdVQL8mtkLtSQSqY1zaYs5Z3ZrcL\nBgv/ovB1GKHkKQVWyQEPS4HRX/DWwMTsF2JrOu8YxY8vTXzQSbwQbYp6KYBP\niUwJ3wXHCmQn15QQdB0OhQTEeiLhxm3AdO2rjplZcEoPURW1JmDeVS+pR7P7\nOuWKpTsSn+TVPkxZVnNxBhx6DMSg+nMBEYKQd6R/wXNgllvnS0d8e+RAEC7J\nIj5H3AlUR4Ffsp6NKpPHx4ilHCTnug1LjaoAQmMWBR/z5/mwN7pOiVc1sFmV\nWztM2Mfm5xvo5ijstlBP+zuxqbagIQ+azRWCm+Dlkb3hlrBaFM1O/Ice2FWw\noTT58ixde7X0cfQ8nH1nMQ4OHJ0V8G/8hczxt5D4xI0B5frGUjv5gUBWcAYJ\nyCQ+TmVd1SQe1Ts8yyOIVn4i6FwYYgQ0Zn32sgcQI4aO7H6dq/+6+9A4S8Pw\nNHp/0Vbce/EjNTcskCmuyq807xJ6lSMr9QGOBzvIXPE6SquWbV3jMm7mH2pO\noi7r\r\n=OXMR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCzj9DN6ZTb+TJEVlu8aAv147Vw9vEceLLLf2Dd0a2xbQIhANrpImN+w3hrx9PI0lGNYIN54AYJnDjQU+hudTTBG9tG"}],"size":15064,"noattachment":false,"key":"/@grpc/proto-loader/-/@grpc/proto-loader-0.6.0-pre16.tgz"},"maintainers":[{"name":"murgatroid99","email":"mlumish@google.com"},{"name":"grpc-packages","email":"grpc-packages@google.com"},{"name":"nicolasnoble","email":"nicolas@nobis-crew.org"}],"_npmUser":{"name":"murgatroid99","email":"mlumish@google.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/proto-loader_0.6.0-pre16_1603316240833_0.8098965780953811"},"_hasShrinkwrap":false,"publish_time":1603316241037,"_cnpm_publish_time":1603316241037,"dist-tags":{"generator-draft":"0.6.0-pre18","latest":"0.8.1","prerelease":"0.7.9-pre.1"}}