{"_id":"ts-protoc-gen","_rev":"106-c922e109eacf20255d3f2a3f6a9e11a4","name":"ts-protoc-gen","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","dist-tags":{"latest":"0.15.0","next":"0.15.1-pre.a71b34e"},"versions":{"0.1.0":{"name":"ts-protoc-gen","version":"0.1.0","description":"Protoc Plugin for TypeScript Declarations","scripts":{"lint":"tslint src/**/*.ts test/src/**/*.ts","lint:fix":"npm run lint -- --fix","lib:clean":"rm -rf build","lib:build":"npm run lib:clean && tsc","lib:build:watch":"watch-run -p './src/**/*.ts' \"npm run lib:build\"","lib:dev":"npm run lib:build:watch","build":"npm run lib:build","test:generate":"cd test && rm -rf generated && ./generate.sh","test:generate:watch":"cd test && watch-run -p 'proto/**/*.proto' \"npm run test:generate\"","test:mocha":"mocha --require source-map-support/register ./test/build/**.js","test:build":"cd test && rm -rf ./build && tsc","test:build:watch":"watch-run -p './test/src/**/*.ts,./test/generated/**/*.d.ts,./bin/*' \"npm run test:build && npm run test:mocha\"","test:dev":"concurrently \"npm run test:generate:watch\" \"npm run test:build:watch\"","test":"npm run lint && npm run build && npm run test:generate && npm run test:build && npm run test:mocha","dev":"npm run test; concurrently \"npm run lib:dev\" \"npm run test:dev\""},"bin":{"protoc-gen-ts":"protoc-gen-ts"},"repository":{"type":"git","url":"github.com/improbable-eng/ts-protoc-gen"},"keywords":["protobuf","protoc","typescript","ts","grpc","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.2.0"},"devDependencies":{"@types/google-protobuf":"^3.2.2","@types/chai":"^3.4.35","@types/mocha":"^2.2.40","@types/node":"^7.0.5","babel":"^6.5.2","chai":"^3.5.0","concurrently":"^3.4.0","mocha":"^3.2.0","source-map-support":"^0.4.14","tslint":"^4.5.1","typescript":"^2.2.1","watch-run":"^1.2.5"},"gitHead":"4d5f18bde952c221de9c468a23ef47561340105f","_id":"ts-protoc-gen@0.1.0","_shasum":"9e4a69fe00adb82b77e6ce65a55eb47d6bc500d7","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.3.2","_npmUser":{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"},"dist":{"shasum":"9e4a69fe00adb82b77e6ce65a55eb47d6bc500d7","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.1.0.tgz","integrity":"sha512-IZUECo45YUUwcvFegV44HRxG5CIYhuusmCtnTF9Yrpn7LnaX78HIyoiMG6NjD9oWjRsKJhrhwruAFjyiamWA/w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGiuZr1FgmAoFcCp2EYnpJFHx1YMJMiNBq+ZJtCx/fDUAiEAs4GfShbCr4DETS/sY4AbDyGQ/BA06uV6XxnZBx3dnHY="}]},"maintainers":[{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/ts-protoc-gen-0.1.0.tgz_1490525719514_0.1675196981523186"},"directories":{}},"0.1.1":{"name":"ts-protoc-gen","version":"0.1.1","description":"Protoc Plugin for TypeScript Declarations","scripts":{"lint":"tslint src/**/*.ts test/src/**/*.ts","lint:fix":"npm run lint -- --fix","lib:clean":"rm -rf build","lib:build":"npm run lib:clean && tsc","lib:build:watch":"watch-run -p './src/**/*.ts' \"npm run lib:build\"","lib:dev":"npm run lib:build:watch","build":"npm run lib:build","test:generate":"cd test && rm -rf generated && ./generate.sh","test:generate:watch":"cd test && watch-run -p 'proto/**/*.proto' \"npm run test:generate\"","test:mocha":"mocha --require source-map-support/register ./test/build/**.js","test:build":"cd test && rm -rf ./build && tsc","test:build:watch":"watch-run -p './test/src/**/*.ts,./test/generated/**/*.d.ts,./bin/*' \"npm run test:build && npm run test:mocha\"","test:dev":"concurrently \"npm run test:generate:watch\" \"npm run test:build:watch\"","test":"npm run lint && npm run build && npm run test:generate && npm run test:build && npm run test:mocha","dev":"npm run test; concurrently \"npm run lib:dev\" \"npm run test:dev\""},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"github.com/improbable-eng/ts-protoc-gen"},"keywords":["protobuf","protoc","typescript","ts","grpc","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.2.0"},"devDependencies":{"@types/google-protobuf":"^3.2.2","@types/chai":"^3.4.35","@types/mocha":"^2.2.40","@types/node":"^7.0.5","babel":"^6.5.2","chai":"^3.5.0","concurrently":"^3.4.0","mocha":"^3.2.0","source-map-support":"^0.4.14","tslint":"^4.5.1","typescript":"^2.2.1","watch-run":"^1.2.5"},"gitHead":"49ab785c5ee8fc15adb01c33f062ebb50fcbe259","_id":"ts-protoc-gen@0.1.1","_shasum":"2c45bd121816f39461693d3a0c3bac6c56254f9b","_from":".","_npmVersion":"2.14.12","_nodeVersion":"4.3.2","_npmUser":{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"},"dist":{"shasum":"2c45bd121816f39461693d3a0c3bac6c56254f9b","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.1.1.tgz","integrity":"sha512-5enCFHO/XyXTqIBKBBZLtCwhn5ad2SJt4cDLXp3L+AslI0lAV9yfGsVYvQdnHGW4TQ7nTTrlM6D1cmhDJbxBTA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGAwmlmCHUoVjw1U6gJDJqka4QoZoLgHJ7aALhd9IZMrAiEA/e+zIEcZ99LGpmoE/U8lq+0RYQ33ylGNaVVa8acTxpg="}]},"maintainers":[{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/ts-protoc-gen-0.1.1.tgz_1490526832132_0.1694186613894999"},"directories":{}},"0.2.1":{"name":"ts-protoc-gen","version":"0.2.1","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint src/**/*.ts && (cd test && npm run lint)","lint:fix":"npm run lint -- --fix && (cd test && npm run lint:fix)","clean":"rm -rf lib","build":"npm run clean && tsc","test":"npm run lint && npm run build && (cd test && npm run test)"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts","protoc-gen-js_service":"bin/protoc-gen-js_service"},"repository":{"type":"git","url":"github.com/improbable-eng/ts-protoc-gen"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.2.0"},"devDependencies":{"@types/chai":"^3.4.35","@types/google-protobuf":"^3.2.4","@types/mocha":"^2.2.40","@types/node":"^7.0.5","babel":"^6.5.2","chai":"^3.5.0","mocha":"^3.2.0","source-map-support":"^0.4.14","tslint":"^4.5.1","typescript":"^2.2.1"},"gitHead":"9ef14bbc464772bd446ac1cd52f75b0f75e2c4b5","_id":"ts-protoc-gen@0.2.1","_shasum":"cec69c8002b68994e4e1d5fe42d89a3c6f659532","_from":".","_npmVersion":"3.3.9","_nodeVersion":"4.2.1","_npmUser":{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"},"dist":{"shasum":"cec69c8002b68994e4e1d5fe42d89a3c6f659532","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.2.1.tgz","integrity":"sha512-c9beL9jCSXaM4ONdH/mPZrTVouSqozyfZ4IoxW9JnhWtb2RGc6jSYb2D4KhnBx4lErnvLo803TJghAEFCUsRJA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDUZQOIy3L4HUkrb1p0HvTja/CWEWVld89dPxHgtUOOpgIhANOIGFYz58H1zLkJAib2jEokLuC/V5+IAUGPJ4Y9tb0Z"}]},"maintainers":[{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/ts-protoc-gen-0.2.1.tgz_1491077556159_0.8469333222601563"},"directories":{}},"0.2.2":{"name":"ts-protoc-gen","version":"0.2.2","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint src/**/*.ts && (cd test && npm run lint)","lint:fix":"npm run lint -- --fix && (cd test && npm run lint:fix)","clean":"rm -rf lib","build":"npm run clean && tsc","test":"npm run lint && npm run build && (cd test && npm run test)"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts","protoc-gen-js_service":"bin/protoc-gen-js_service"},"repository":{"type":"git","url":"github.com/improbable-eng/ts-protoc-gen"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.2.0"},"devDependencies":{"@types/chai":"^3.4.35","@types/google-protobuf":"^3.2.4","@types/mocha":"^2.2.40","@types/node":"^7.0.5","babel":"^6.5.2","chai":"^3.5.0","mocha":"^3.2.0","source-map-support":"^0.4.14","tslint":"^4.5.1","typescript":"^2.2.1"},"gitHead":"af82fa1bfe7e0ecc3742f27daa3e22ade87c131c","_id":"ts-protoc-gen@0.2.2","_shasum":"39f8a4bf3f970a2fa198cd965f4601efd0a0553c","_from":".","_npmVersion":"4.2.0","_nodeVersion":"5.7.1","_npmUser":{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"},"dist":{"shasum":"39f8a4bf3f970a2fa198cd965f4601efd0a0553c","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.2.2.tgz","integrity":"sha512-W73JNE/XZu3Ndk4qYdLY0BB9ghLXSE7GWOoSxNtLMz0rWO4CN91VRwGtS3qDV7PBh0XRwmCQwYCfgz4PU0FEFg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFelrBh+bBiI2RZ9TwSe43zJT6zIepdRJQs5TEs0yjySAiEA2ES+SeRe7wsZjnGx+52yV1ca2R6mDHD0tApaGERz9hc="}]},"maintainers":[{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/ts-protoc-gen-0.2.2.tgz_1493294489709_0.022345853969454765"},"directories":{}},"0.3.0":{"name":"ts-protoc-gen","version":"0.3.0","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint src/**/*.ts && (cd test && npm run lint)","lint:fix":"npm run lint -- --fix && (cd test && npm run lint:fix)","clean":"rm -rf lib","build":"npm run clean && tsc","test":"npm run lint && npm run build && (cd test && npm run test)"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts","protoc-gen-js_service":"bin/protoc-gen-js_service"},"repository":{"type":"git","url":"github.com/improbable-eng/ts-protoc-gen"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.2.0"},"devDependencies":{"@types/chai":"^3.4.35","@types/google-protobuf":"^3.2.4","@types/mocha":"^2.2.40","@types/node":"^7.0.5","babel":"^6.5.2","chai":"^3.5.0","mocha":"^3.2.0","source-map-support":"^0.4.14","tslint":"^4.5.1","typescript":"^2.2.1"},"gitHead":"d4fb4eace3b032288b03aed8ba5a25fddadad256","_id":"ts-protoc-gen@0.3.0","_shasum":"c937ba0a51dee4935f4d106dfbfb81a82884b752","_from":".","_npmVersion":"3.3.9","_nodeVersion":"4.2.1","_npmUser":{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"},"dist":{"shasum":"c937ba0a51dee4935f4d106dfbfb81a82884b752","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.3.0.tgz","integrity":"sha512-IHUpf6um1MKuapbXoJ58p7MWI0RTMApmEe4lgyY+EV6+kB+iNE1qw9h5Rx2Ko61k5jYi0GHyv6UN9+wSYnLwYQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCb3fHpyLIpbCPfBM1qek7Bw2Pnz1ITKLAh5H5gJspgoQIhALW+DNOuMi0RdVcTe4GJ3GqWTXKEs7NCsrdi41V+Ga9o"}]},"maintainers":[{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/ts-protoc-gen-0.3.0.tgz_1493653546941_0.9914596290327609"},"directories":{}},"0.3.1":{"name":"ts-protoc-gen","version":"0.3.1","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint src/**/*.ts && (cd test && npm run lint)","lint:fix":"npm run lint -- --fix && (cd test && npm run lint:fix)","clean":"rm -rf lib","build":"npm run clean && tsc","test":"npm run lint && npm run build && (cd test && npm run test)"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts","protoc-gen-js_service":"bin/protoc-gen-js_service"},"repository":{"type":"git","url":"github.com/improbable-eng/ts-protoc-gen"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.2.0"},"devDependencies":{"@types/chai":"^3.4.35","@types/google-protobuf":"^3.2.4","@types/mocha":"^2.2.40","@types/node":"^7.0.5","babel":"^6.5.2","chai":"^3.5.0","mocha":"^3.2.0","source-map-support":"^0.4.14","tslint":"^4.5.1","typescript":"^2.2.1"},"gitHead":"08ac5c80bb43c3e2f40cd0d10ebcc0d60e8f27b8","_id":"ts-protoc-gen@0.3.1","_shasum":"d4105c7d89c56e4dc778b8ebe73907760399ae68","_from":".","_npmVersion":"4.2.0","_nodeVersion":"5.7.1","_npmUser":{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"},"dist":{"shasum":"d4105c7d89c56e4dc778b8ebe73907760399ae68","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.3.1.tgz","integrity":"sha512-5jE3StW8YMKWD5QC8RbpmvAxfuXMHaZb4LbtHmgXe6KQmLZFIhCB04DkFWvcpmDnpa/QOZ4tQ82IPF3m7KytpA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIQDRKxmhl9PxNKDlz2qL1Spl6X1Q6K6zBQf0m8xl8ahWiwIfPWGMHQHkTRvk22lDLnCwWYy8xQgqkM9U4HiV5sEjyw=="}]},"maintainers":[{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/ts-protoc-gen-0.3.1.tgz_1494324744937_0.25340257002972066"},"directories":{}},"0.3.2":{"name":"ts-protoc-gen","version":"0.3.2","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint src/**/*.ts && (cd test && npm run lint)","lint:fix":"npm run lint -- --fix && (cd test && npm run lint:fix)","clean":"rm -rf lib","build":"npm run clean && tsc","test":"npm run lint && npm run build && (cd test && npm run test)"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts","protoc-gen-js_service":"bin/protoc-gen-js_service"},"repository":{"type":"git","url":"github.com/improbable-eng/ts-protoc-gen"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.2.0"},"devDependencies":{"@types/chai":"^3.4.35","@types/google-protobuf":"^3.2.4","@types/mocha":"^2.2.40","@types/node":"^7.0.5","babel":"^6.5.2","chai":"^3.5.0","mocha":"^3.2.0","source-map-support":"^0.4.14","tslint":"^4.5.1","typescript":"^2.2.1"},"gitHead":"82080dc1ad257cf5d16c3eb32914372dd48b848a","_id":"ts-protoc-gen@0.3.2","_shasum":"299a16c922d34c86e92c60fb1071e34466b05a3b","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.0","_npmUser":{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"},"dist":{"shasum":"299a16c922d34c86e92c60fb1071e34466b05a3b","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.3.2.tgz","integrity":"sha512-H+uK9l9/F/aBHVGWgfRvK3/fC/5LHdS/Iejbz9g0QNQQicSCKmJgWSVweh7qYRPet5t+j0dg36c2wNoAKHuZIA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIQC98SN2VF6VLh0xTZ2D9njVvL4H5k1tnkItEaCcLSb7BgIfUzyts5rvG2fgH1I5H3O6+IAzeRhFiVCJGuYPsG+owg=="}]},"maintainers":[{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen-0.3.2.tgz_1498422170683_0.6371665732003748"},"directories":{}},"0.3.3":{"name":"ts-protoc-gen","version":"0.3.3","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint src/**/*.ts && (cd test && npm run lint)","lint:fix":"npm run lint -- --fix && (cd test && npm run lint:fix)","clean":"rm -rf lib","build":"npm run clean && tsc","test":"npm run lint && npm run build && (cd test && npm run test)"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts","protoc-gen-js_service":"bin/protoc-gen-js_service"},"repository":{"type":"git","url":"github.com/improbable-eng/ts-protoc-gen"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.2.0"},"devDependencies":{"@types/chai":"^3.4.35","@types/google-protobuf":"^3.2.4","@types/mocha":"^2.2.40","@types/node":"^7.0.5","babel":"^6.5.2","chai":"^3.5.0","mocha":"^3.2.0","source-map-support":"^0.4.14","tslint":"^4.5.1","typescript":"^2.2.1"},"gitHead":"a7b089213fd74575b68f5ea39397b8c7f205a7c9","_id":"ts-protoc-gen@0.3.3","_shasum":"cf532e5fdab74fbf2d68833da6a1c721737e73e7","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.0","_npmUser":{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"},"dist":{"shasum":"cf532e5fdab74fbf2d68833da6a1c721737e73e7","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.3.3.tgz","integrity":"sha512-6Z1G43HdEpiB7Iz8fWhszNYwLtgb/DMs/LvbW8srbaW0Hga8PzI0U+IeLlkZNRj9j0KiPFAkKlL3k43Kdc5V/g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAfG7q7C8UEky6AH/lncZPJ7yBCz39F26GfcBcKceshaAiAjHuFJcrQo2OgmDHQBZt8MFLDSFl0tI0zVcwsM+6QPYQ=="}]},"maintainers":[{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen-0.3.3.tgz_1501450126060_0.19522637873888016"},"directories":{}},"0.4.0":{"name":"ts-protoc-gen","version":"0.4.0","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint src/**/*.ts && (cd test && npm run lint)","lint:fix":"npm run lint -- --fix && (cd test && npm run lint:fix)","clean":"rm -rf lib","build":"npm run clean && tsc","test":"npm run lint && npm run build && (cd test && npm run test)"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts","protoc-gen-js_service":"bin/protoc-gen-js_service"},"repository":{"type":"git","url":"github.com/improbable-eng/ts-protoc-gen"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.2.0"},"devDependencies":{"@types/chai":"^3.4.35","@types/google-protobuf":"^3.2.4","@types/mocha":"^2.2.40","@types/node":"^7.0.5","babel":"^6.5.2","chai":"^3.5.0","mocha":"^3.2.0","source-map-support":"^0.4.14","tslint":"^4.5.1","typescript":"^2.2.1"},"gitHead":"7de95222eb74f0840fe51b9d6b7a07efd6aadec5","_id":"ts-protoc-gen@0.4.0","_shasum":"e08e6cfec55ff4bf87bf02f72075199c871e001f","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.0","_npmUser":{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"},"dist":{"shasum":"e08e6cfec55ff4bf87bf02f72075199c871e001f","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.4.0.tgz","integrity":"sha512-MwwEg7c0pziCZgpWw3ejfwkwxs1By6T0Jc9NPeXb9bJ55+Jpf1qX83cFamvueoFDdA1WIMRULNkh5BmF9DKfVA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGNJHX9CA4ZY+C+nTrAsrwUmQgR4B1siT88rKI7V/G9nAiEAzNHh8qsGiZT4o+cZ7Ahqs9JmogKGBN3MYfcUiBnIehM="}]},"maintainers":[{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen-0.4.0.tgz_1502894919361_0.46920545562170446"},"directories":{}},"0.5.0":{"name":"ts-protoc-gen","version":"0.5.0","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint src/**/*.ts && (cd test && npm run lint)","lint:fix":"npm run lint -- --fix && (cd test && npm run lint:fix)","clean":"rm -rf lib","build":"npm run clean && tsc","test":"npm run lint && npm run build && (cd test && npm run test)"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.2.0"},"devDependencies":{"@types/chai":"^3.4.35","@types/google-protobuf":"^3.2.4","@types/mocha":"^2.2.40","@types/node":"^7.0.5","chai":"^3.5.0","mocha":"^3.2.0","source-map-support":"^0.4.14","tslint":"^5.9.1","typescript":"^2.2.1"},"gitHead":"e89e34aa3859ec5b07b24642c24f569016c20d17","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.5.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-KQ4sEhbhmTdh7xetLkjeAuF9Xa3ULc9SpEgYiC2U+RRvGzDDVoGAiuQFnW879iPcCKqVNehnKaSxOn37KbRdrg==","shasum":"83d25bdda5e1f1ce02ba7665467065bc274df46b","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.5.0.tgz","fileCount":46,"unpackedSize":87613,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE1uR+4/s6+dYqcQvYf++7tEX35kpJq6dYJ0RqEq1vtTAiEAoLleDvs7N08azQ5OpVM9fgqutDbDzUvwtLBtGEFlTts="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.5.0_1522097579623_0.35953680919895725"},"_hasShrinkwrap":false},"0.5.1":{"name":"ts-protoc-gen","version":"0.5.1","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint src/**/*.ts && (cd test && npm run lint)","lint:fix":"npm run lint -- --fix && (cd test && npm run lint:fix)","clean":"rm -rf lib","build":"npm run clean && tsc","test":"npm run lint && npm run build && (cd test && npm run test)","prepublishOnly":"npm build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.2.0"},"devDependencies":{"@types/chai":"^3.4.35","@types/google-protobuf":"^3.2.4","@types/mocha":"^2.2.40","@types/node":"^7.0.5","chai":"^3.5.0","mocha":"^3.2.0","source-map-support":"^0.4.14","tslint":"^5.9.1","typescript":"^2.2.1"},"gitHead":"ad69505a38a76a2ae38c5403b6a84e4245abb9f0","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.5.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-liLhB9jSjqDQzYXBYvpgqWteOaxTRivM1NIMlhbqCNXlAkg2pnu5wA1CbZBzFSmKjhrnbFLB4tzYRJc2vaB8zg==","shasum":"4bba15628b9732ad5c8f51c29b6886b2b334ca1d","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.5.1.tgz","fileCount":46,"unpackedSize":87719,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhJf+ujYJcHrhB8GJtG/2wTkjbUVpvsaPU3h8IE+a6pQIgGnrsYMqqpnCX+g9y8o110k0MJJo31hoYJxMBOxBKIUc="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.5.1_1522146557552_0.6713136763610956"},"_hasShrinkwrap":false},"0.5.2":{"name":"ts-protoc-gen","version":"0.5.2","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint src/**/*.ts && (cd test && npm run lint)","lint:fix":"npm run lint -- --fix && (cd test && npm run lint:fix)","clean":"rm -rf lib","build":"npm run clean && tsc","test":"npm run lint && npm run build && (cd test && npm run test)","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.2.0"},"devDependencies":{"@types/chai":"^3.4.35","@types/google-protobuf":"^3.2.4","@types/mocha":"^2.2.40","@types/node":"^7.0.5","chai":"^3.5.0","mocha":"^3.2.0","source-map-support":"^0.4.14","tslint":"^5.9.1","typescript":"^2.2.1"},"gitHead":"3b722bfeda5864bbd64b1df7f476b138ab3f5da4","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.5.2","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-dInguEKMvpXqnqMWPUgm4JNzPcvVNQqkWm0oi15ViQBkelHJfsm1hBKWBPCQS+qY3A7HxRyKzs8Beetm+IHJcQ==","shasum":"ef5ae92d4562141fe47ebfdcd53e8eace9a35355","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.5.2.tgz","fileCount":46,"unpackedSize":87954,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCS8UYm1Wi3aqv4tDDDO5TJGB3toIDgkBmJ2ZqiyyIk7AIhAKmUN1QUETs1UGWVLO6BhAle6rHjIvs/3o9u3SsAjoNk"}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.5.2_1522146679356_0.3487607241002879"},"_hasShrinkwrap":false},"0.6.0":{"name":"ts-protoc-gen","version":"0.6.0","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint src/**/*.ts && (cd test && npm run lint)","lint:fix":"npm run lint -- --fix && (cd test && npm run lint:fix)","clean":"rm -rf lib","build":"npm run clean && tsc","test":"npm run lint && npm run build && (cd test && npm run test)","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.5.0"},"devDependencies":{"@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","@types/text-encoding":"0.0.32","babel":"^6.5.2","chai":"^3.5.0","grpc-tools":"^1.6.6","grpc-web-client":"^0.5.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^3.5.3","source-map-support":"^0.4.18","text-encoding":"^0.6.4","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"dbcd6ba350cc83edf14e85add5eb1bea2e8ba7fd","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.6.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-dWxB6sc9BRJcCkeCb9NdNsH/zj/nmy1mwoUCnC9BQSnX8BO2UhWGM9J4ufIdH9QLQpzFYhPgxT8hqDUihLnqPg==","shasum":"01f91f3d8da0085720d85706caa5a6185daafdd9","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.6.0.tgz","fileCount":51,"unpackedSize":113185,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa2DW9CRA9TVsSAnZWagAAtUYP/j8NVTuGtBdcUbJoJPkt\nHrh7dSDaoL0EiJADFi3Imy76S+wQwETyovWiC3ZCLR3HmwS9piQ09LqFKm7p\nfvz+Zy0p/M9j3aNJX/ThPvMf0KEXcfokokM8Igeg4EzIauYzj3UeFfgHOT0X\nytN2nxLtP3WmIADUnSgWkPemZu6ztMg0UTeqRjGli7fNyxkTqKmt8r0aMaBu\nUE4KViQn5YlzyMc8Icl7vFxFv1QFond1Fk4b3MxRjX2ps3ZzboBPThAda+0O\nSvdcGFwPOfkixfSrlKSsr3ni+Xi45FTbA+pjvbrsrUx86AJcIlSMA+jESlSG\nxnrJ58MS/QUq3DTVnUysCkNr6ITIWC3A2vds2LuQW4L9tXvoUi+8cejEBINf\n9iL3t8Kpqyk6WyCSpwEf2X2IoQ7Df27fSxnmnJjE+qkP8d+vTUsFh1KF0qvL\nvyslACwb6n/HxwdTR7CvMhwUrNg1MdWATgsFaFdJet3Gfy3j9Zg7rZFlsH20\nueLdvy9wgJyR5t+Y+GZnKqrsLciEK8ItRTrUd3D8BgZ8HDPM8RLoizKU/nIC\nP3DXw92cIkC9uWd5BwIBOeZ5bG4RDnje9FtPab1tnQhYsNwsfnPhyoA7bylR\n2gq8tx6OjCMnKwMZ1jhLgP5L3kQEDnFt6W60stTX7u712T7qRwBSNMU/PeIH\nXrFy\r\n=XJ7h\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDs4lJAV+AFTf5OH9wMuOPqH91IcfhcIRJZLGn72d+nPQIgDvD/bdGE8szOODBSuNLabmhgbaLCG5VTUDJoR3/jjhI="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.6.0_1524118972461_0.41800217841598397"},"_hasShrinkwrap":false},"0.7.0-pre":{"name":"ts-protoc-gen","version":"0.7.0-pre","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.5.0"},"devDependencies":{"@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","chai":"^3.5.0","grpc-tools":"^1.6.6","grpc-web-client":"^0.5.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^3.5.3","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"eee996e9d27caadb4bed65fd5e9bb32f0cef06d1","readme":"# ts-protoc-gen\n> Protoc Plugin for generating TypeScript Declarations\n\n\n[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n![quality: alpha](https://img.shields.io/badge/quality-beta-orange.svg)\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations \n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n* Install the standard C++ implementation of protocol buffers from [developers.google.com/protocol-buffers](https://developers.google.com/protocol-buffers)\n* Install this package using npm, eg: `npm install ts-protoc-gen` or clone, install and build this repository.\n\n## Usage\nAs mentioned above, this plugin for `protoc` serves two purposes:\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n```js\nimport { UserServiceClient, GetUserRequest } from \"../generated/users_pb_service\"\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => { /* ... */ });\n```\n\n## Examples\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples)\n\n\n## Contributing\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.7.0-pre","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-Iw7qZvYSPggTLu4gjGHdWK5PIMjJesSsd7mIugVVQYhgWy2688ENy8GaxPn33fJwLToiDn/61zTb884afzlMIw==","shasum":"9ecea82eba8fa082d522f06bed750b99461839dc","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.7.0-pre.tgz","fileCount":83,"unpackedSize":95259006,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbB8wOCRA9TVsSAnZWagAAvIEQAJQPH82VKJrhJmKmcpO/\nQKrHi4UMQL+eu0xlKPl/jjoH0ndYc/q9dDtWXba/Bwnf9T+rfRx9uQIkww3g\n6vbDXeOrHNIhzCXrUwdM5IYhCrAvUI1CZlF0vQbhJO6WhGhksNfjsc47ld5f\n7OYLk5r+mH2VK2qsuI7md/pcd+BM3hVUOhsl6gVnV+A91WM7b4hj7F3jPZ0a\nvY9wceytwZ22y0AquhToPs/KKpZi+EBxrzcRJ/pqrDxqvQHZCTnKQ5ceBDil\nnPmqZh9qMJ0AC2pLX1YQmqabgoE4nhm7aC7A/PgTJ1rX+a2eVUA/HXEIIPhr\n5VqDR+Auyg6pyB1Q7uLZjsiUNGQTs3+WoJ8Z8LaQH8vNSY8TWTNDkGooP8Jc\nZY/uezOnLJkdJ9+qvJzDwb5pikcDPlqOhBZr+I77xEKlpby6U9AGkGC5G8EJ\nZxywRXy+oAdRaq+5Rz7vvgtGiuSZUZ7pbZ3YkmNYs3LHTJ1UgXKzqeVZGvFj\n2ZCnd7uuy0IvXTAHJ2KRxqqbcXiSnCE1qyIVfItsaxwtWLEKRmQGGtBpJk0N\nVp9pqYkiTOvSljiP+SrS38+bmsH9i/vLzYi8HDydCEMED16diCHzhByHA3ks\n3ahVjN3WKXu6F064+P7dfwMoZpAgNse26OVpMEFWslhT6i82LeZzRh444BXg\nY5EK\r\n=J64M\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCsBfCpDHL3IRk/xMN/T06p4fl2t6YsFEXVX0E7zPXFKgIhAJTti/aWqaGMlPFCXBMBZp1TTa+k+g6kvV9u6OdFuap/"}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.7.0-pre_1527237640440_0.076422654049777"},"_hasShrinkwrap":false},"0.7.1-pre":{"name":"ts-protoc-gen","version":"0.7.1-pre","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.5.0"},"devDependencies":{"@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","chai":"^3.5.0","grpc-tools":"^1.6.6","grpc-web-client":"^0.5.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^3.5.3","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"e7d7e8097278e6793bafbcbc5c6a23c99c8257cd","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.7.1-pre","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-DUTuCnA+imv8NXCm+mbETtvIcK8n1SKj6tGS8QkOep10ldzZV6cPfjQ+bTyVndQwN5ps74z5q3jKtTyViQcfXg==","shasum":"66693c97f0e0c263b489c8668c9ba0feb4bf4be2","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.7.1-pre.tgz","fileCount":84,"unpackedSize":95259070,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbCQLQCRA9TVsSAnZWagAA3m0P/1TVNe0nvaA2l2nQ4vCC\nHoot95vhljmzXNQZ/Ifq7idu9+VglP6Z3bvk3RIrS9Mbno4ayzxnaezpIfeD\ns8DTmYYnozNW3S27yyZc++vDrLipeV4UhYqgkbZe1m22Ug10TAWo0qug245r\nViwPIzIRVejZfXgn9cLMQHItPNMC1HKpoVV/P9zb8Ix+8kfEet47WnW6045S\nhLZfgbwyWdcB2QSFFc1ql2POoALZ/YQA0xdUTwGXM8oVGn/Lg0Q6nTOTjOvb\nfcdo1JaPaLSPJoCxAoa3ei2IR1OY9auduVE6HhOib83uetchvf1E4qMSi1Yj\nl6YrXbuUjcBYsWd9twYhLtl7mlSv+f8IE/eAHTTq1jpFYbavNy8/JUMHV6Fk\nAdOON1PRW48z13/C9dLEbHg48Oqm+F9UUzYJOfkx4Eic3A+2gp5q+cd2a9yr\nvl1p0xjhJ57KMCMmkLUxGqQXNuXxVDkveEvXYPVVqfHtgQbJPy61okonakGD\nxm49qG2uFXKPwix3ePT5rZjII6E5t7z8oiK39yBXBrUw734F/dE2j/5IdgbP\nmiHTze5oPxCQ6IyL5eZnJvJrCbhonq6PKpvvgVQiSysVFknUQYRRx2MhaWiq\n0pffVPzF3RFpIu+nzxKRZ4rJqE+2a8jgTPfriR5V7gse3sO/rid10AGDGbcY\ns7sc\r\n=LrPt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBEbkAhozNhJAZglBYx7bCgy8FLvWCYfm8EpiVbMtI6FAiEA3yfXvzHWoYvVbzNt/jnsC6PIRiSDWNxYoDYL0ScLDfU="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.7.1-pre_1527317196762_0.9999938160370558"},"_hasShrinkwrap":false},"0.7.1-pre.44987dc":{"name":"ts-protoc-gen","version":"0.7.1-pre.44987dc","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.5.0"},"devDependencies":{"@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","chai":"^3.5.0","grpc-tools":"^1.6.6","grpc-web-client":"^0.5.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^3.5.3","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"1ed6e098a8c1d4a676ea57cc7c35ff49a0ce7a01","readme":"# ts-protoc-gen\n> Protoc Plugin for generating TypeScript Declarations\n\n\n[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n![quality: alpha](https://img.shields.io/badge/quality-beta-orange.svg)\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations \n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n* Install the standard C++ implementation of protocol buffers from [developers.google.com/protocol-buffers](https://developers.google.com/protocol-buffers)\n* Install this package using npm, eg: `npm install ts-protoc-gen` or clone, install and build this repository.\n\n## Usage\nAs mentioned above, this plugin for `protoc` serves two purposes:\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n```js\nimport { UserServiceClient, GetUserRequest } from \"../generated/users_pb_service\"\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => { /* ... */ });\n```\n\n## Examples\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples)\n\n\n## Contributing\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.7.1-pre.44987dc","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-FeH1u7JS0WjTe7sPG3njir2xN91btNyrQJ6jBwOY9+VuKkBeFsITQKZ8cme2IqDZ0syRzwKP9Q4o14ZAJByrAw==","shasum":"219a4907a3be3d56887395bbe2642013d1fa5bba","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.7.1-pre.44987dc.tgz","fileCount":84,"unpackedSize":95259078,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbCQsOCRA9TVsSAnZWagAAtVIQAJ95eKy7m1BmIH5DoAnd\n60LDErsgX2ZvFvqjDwEA1E1mftjT6UvcW3eq6ULPyy1nxZaaBuX2P9oyKjCl\nnztCZOoo/A8OsIp4OCXUyTDEZMCN3R4I+0EbbmB5QQQo6ZafO+ZUiu8dtlgw\n15C1cFIBmkShfKrDamX6pvkO7J26KxEsdKjTyqzmsCDF4b9ukOcMyis9/V1E\ntjPO+I9mVVPJd+A4ybX+O6DRyjMCS44bdQ2nWfntCOv4L0XCAnN/RsBMFLou\n8RDt+W8V8dYogyvuvSalPW4OZVNAzhZIRMuhQFz0gBQDMFzuMLWByhCBbe13\ny/Z03NTZO/1y1nEdANU+OjVe2D19xiV9n2ObMYIPOuRmIlFJYcx2Db2eCAhz\no7pXJmlINjAzjbiy3dBnxcukP3v0SvV0aDnewKhbrAiGuxzG3zKP/M2zf8mk\nb3Te/TFZNiKVL/aPQPLknLS7VF1cetzkP2dOEG+9zhdQj86ZRQYz2xcAEcCa\ng31uqbC2EXdZEA1UTrwQVmG+7Bpc5/nPpWx9EmzFsm3yB47CjI/5MI7r/ysZ\n9RdV7/YT4ENW4ZJYgFeZ4GlHkVtzfoxUTplXgcZGnsmftqBLG4fsYnyiT5z4\nK4tRLPYF5xJTcG4/dyrp43pCoKMP7POoCxNPGjkAyV7rB8ShSLcdRj7WYDDK\nmmwq\r\n=IDKY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCKFLesbIolCew/5MHT+yjQvpJ5CWF2b7WkUpZOCaw5YQIhAIGBAry7rOm4OVqD7GJ+3HOwQFCz8yQPFYdnnZKuPUoq"}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.7.1-pre.44987dc_1527319305788_0.4542590231303443"},"_hasShrinkwrap":false},"0.7.0":{"name":"ts-protoc-gen","version":"0.7.0","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.5.0"},"devDependencies":{"@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","chai":"^3.5.0","grpc-tools":"^1.6.6","grpc-web-client":"^0.5.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^3.5.3","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"4b066fc708a46fd6229fff1773a5514a33e3923a","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.7.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-QZ8fFaHfyuwcrsRDYcKNNIcN5qcTHN4VyV0r7/wQPVhx9eSNX26AYw1kyr7/jprVVnApDlpGjIGI3q8oFC0QiA==","shasum":"7e3d9dcb123782a0e19a804cb7d22056e6d1c5c9","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.7.0.tgz","fileCount":84,"unpackedSize":95259049,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbCWksCRA9TVsSAnZWagAAcrEP/1gBy23FHzTIYygOdk2J\nAO6MVOTSHXusenp1DgTYp1Fw9uoobPMiNZgE8nJleR2mDfZrDU1frZqwFsFh\nWwTU39e+JAzZhTTqN5cr/q28yB8OMqSVUnY70Tb+zU7wkWsAY1z4oeFUWmOF\n2iD9t/TeG9HpPG3bQRZHtKXTy2uay+YcfjGb2cYDabS8MrPbva3CIDlCAltD\ndrGA5CMP94/gDqK693QL355emmX2VeIA9G/c5L0Bx4Isk0Y9CddmVmK5YWQN\naqLJUxCec/arK6fa0JbG5QM3Jti+8y4KfgnNNWvZ1C44QqeohisyQYdCKGdm\nJz95q6m9HeWxsyFASMPkZhEijr4JDQlEtfkkfL4lP0HLyazBs+x5CO/bieDI\n7k0ShUOkRIFzVPjWOh7xbMFrAw200B2VVoC87xrgUPkAn0KO+kmoiACFHYTe\n8HiphsKN8H8vz7bS1WEysMsY/9RqrPu8155ihX2mBH2gSuiKotM2+QEI2Ke9\n7MfvsFJvBXYPbAp4rgE/659N6bB3Zp7fjfAfuNepn9OMAdF4DaUtSpzQBN32\nSq8GgK1wPr/7aHue8TM8HoRdhn7hFSvoMSavve2vuFOyf9IZJJroPtG9159a\n5JifIYbO9+w1RrB1O567sfQaMC8SzjeEeHqxtFkLV4uT5eDh5LRcCOr050tx\ndtIb\r\n=WqTJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAHRabmELapXUZ3/btcTw5h50lnK0UY7dtZCInKvAd6gAiB4Ua9BNghPEsFq87PMTZ1hFVvNeemWa9I6MynEBY8NOw=="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.7.0_1527343400040_0.6681190628545426"},"_hasShrinkwrap":false},"0.7.1":{"name":"ts-protoc-gen","version":"0.7.1","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.5.0"},"devDependencies":{"@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","chai":"^3.5.0","grpc-tools":"^1.6.6","grpc-web-client":"^0.5.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^3.5.3","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"cd2e5e642a1a6ccb4d5534b653212cb15dbef7d7","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.7.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-bfuqHyuk2agVjl8pim4GORnFMF6xk/H2AwKFDvhWl9emOawzJgfPokpR4H1BGmB+AIIWrvGT9gTGTLXENC2mTg==","shasum":"4e08db7544d1a3c3894913516360b50f33c7fe9d","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.7.1.tgz","fileCount":68,"unpackedSize":123879,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbCW0jCRA9TVsSAnZWagAAiKsQAJFByYkgWTuGnA8g/v88\nHyJxHh2odYZ2CSirRIXoZV0zhl+IMF0LsLl5HkIg7qBgkcgVF/Qqsn9I/FMo\nR651Ps2Jb0YtmcbFRS4Y9eA7v1NZuT7KfTYTgb/X9UD0h0qI95w1IKEc3nfv\nnSdjrdeHuJZmU6qsd8icp/0ChF+nj0NCv20KHBuBfzWj9CF+qoj7chI0ZDcO\nxtw0aWJydq+wHUmI17Bf0hxBbWWOoi6dJuue+yTpxKOs8Nod1Q4joj+G/+j1\nWmGfOlgtNPOMGGK72K/B243y0Y/542y6z8cfeTJMxEpKGtyokNM4MBJxjFLq\nIa787CFYxHgBVsRHJbzXl42e02+8JTO8SAlrW7p8Fs8VBQYMqd9XUJMMpfYa\nj4xJtiqbe/ZaMBEhlRE0v9RvRJqgAIqdwAUMTsVuqoY16e+4VlIlmg7sjxor\n/JMc+tfCe7KxeTIIR8HABhX8jQXH0shvsynetcmDjgE6z0k2gIqcpOE4s/3j\npdlIuWHLip4mqG+1xEFiGbNe9ZDjB5Cu949Y/nJgMLBtQaD2y79v+hPJTQn9\n9Utn013nnFEKsEV3S8594VS1sAKtaYmQ9bPhu7NrhFk3lY37RZFL1uRBoYii\nwhc1ISsLDE9lUUw8Udrrl99H82ryvKBMv0Q9p9j8H9SOghrICbZDTUnsJi5h\nuq7Y\r\n=NNot\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAr1z5CLcC4ru9idnxSVUvxjF5xLmqk1e0b9UYQSnqHfAiBgBUcfmwKRZcWnvHnrWHT17MgW7/kTpwel+EFNsawEog=="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.7.1_1527344418564_0.7962673195109284"},"_hasShrinkwrap":false},"0.7.2":{"name":"ts-protoc-gen","version":"0.7.2","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.5.0"},"devDependencies":{"@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","chai":"^3.5.0","grpc-tools":"^1.6.6","grpc-web-client":"^0.5.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^3.5.3","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"e3e5512f925452e56cc3b5ec03ff62de9c2274d4","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.7.2","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-zZ0dlQCgCYQlnUSor3VnnoBKfbpmejQFsx1D0lchW7ntaUThCykMzzsUiKGA5Q2J7V6esUsjcFKIY2RoRDn1pQ==","shasum":"6c1c2fba27c69a0e72afd3bee8b899e640a3b5da","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.7.2.tgz","fileCount":68,"unpackedSize":123937,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbCW9nCRA9TVsSAnZWagAA1VUP/j0ioCjnYT4R0fvfIjJq\nNtzi3ymfOuJisVzv1/kBKm2Lo04lXd+3cWqgga+Hb+uRTRKdskfLfiuFHN2X\nIivyXMkhKghiiX5iixLDI4onR0qEnvUVz1mRAzVtplNFf8ZVu0IwlvhpFHo1\n2KBSCmWtN4nBeYmi9nlItaQDvgyX0J8aWvfMj+eOG/yQzIeqibal6suOcR5k\n1P63/JnwYq8soWf6zjW6TUqI1zNKu69rvnqxFj42iVanYpeZ+dX7MglBzyx0\n7ALCegxaOVZkuNz1mhCsdfaUqJPGcI6niOB3rhXKMRYy5qO6S/C9wjmINEQn\nGcm9/+6WyDofNXbwWzAKa2SEPl3jHymaLCHCPXh8lbgYBtQNyABX4Z6E6YU5\nP9mNhY61rqGIcxRmJhm/5fs1XGfGUKiKvuZUYsJ2xODpDr9vJWREs969n45A\nPGUSP91z+oQbzzAEaI0cWGaAWzJeAPI8shnCaWpqsmCf/hCS+CvSxFJGu023\nAN4kVr2da2/4ztnP1L5wPqKdDu1on9tSzQVBanHsjiv/a/33q0fveP9ViKh8\n9BbgudzqAU2lnHNFVGDNYduR5NH7bx4HlweNTTLuigiM2ekczwjqRitldJWt\nbexAXZtHmqgqWQueQqEVgsmSacM+pBZMFsvvCLtJLs2P+Vj89p/n9DiqI5qi\nRv2z\r\n=HuTF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC12yonDz7q/nVMV54lhhFxZqOMeRiOuffi6xLHEcxppAIgIo8dBW74eKlNvs0i/5ovoD9SWo6+fnzMH5RhuBirt4Y="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.7.2_1527344998021_0.5418937584624435"},"_hasShrinkwrap":false},"0.7.3":{"name":"ts-protoc-gen","version":"0.7.3","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.5.0"},"devDependencies":{"@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","chai":"^3.5.0","grpc-tools":"^1.6.6","grpc-web-client":"^0.5.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^3.5.3","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"e95514acde295ebf206b13e04916c79063789b85","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.7.3","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-Gvkl2ErK812BdArHZ/2gfOZAoh+L0et1ozIImIDnQeMFE6LYiGZdR0/w7suU9PtvdEc2EtCViYWBRp1mIFyo8A==","shasum":"bddbf1b9b053df1c6481c00ddd01feb4bc5a50f9","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.7.3.tgz","fileCount":68,"unpackedSize":123937,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbCXBqCRA9TVsSAnZWagAA2/8P/iNS9orK/fg8/C54Z5bB\nLVPXW6P76hp7sCgf1VDuUGCUsKw60SYLIbROCP7kqA7dfL9G+19oULBVWBPf\nFIodcELkZ3LGLinycbhw5MEZz6FkxmChQVZM8dpPc36XyO9yvOqr2cSdXaFG\nnOD/GqQpDp8oOXCvQoj/qnpzWXcInbVHOATmmxAldyPPnT/kU2glAvndFvdz\nqVVPjWeCDixv5aB0XYGPDBQyY9bkPVeMZYEQCfGXGPwOupX51ENU9mX8fIvV\nfa8zi+pxo6PAbxt2xRvBRJ3uJsNyUiQAOnCFFNlNGm8lXh10XYdZ3DcUVwlN\n5PAw2dFux2ns8GiIwOOZejyi+RqF1NgBvWuH1/WVOdtt8/SA73YsFk1Wl9DR\nqMyaQMMdMKpIlEof7pq8Gcix1YD6kYrVu0wJjqRkLx1k1prLPXA0543BcWxH\nWqZhxBk5uhqL7c8xwICWHwOrichTDP6vk/UVJHe/IQm77HyezLVjPZwOKk6w\n0R5MAskC/x9XTvx5IkhlCIz+XB9zN0vAzOc9VAdkQ7viynXeY9hZx/ZO8yQr\nt6qEIsNj0mW22OUgKNlXVv1L2L+ef4IMw6mrS2nP4qBcsTYNA3eQuMN/o2yi\n6iSIxmChU887ZaOii9Fkg/ArnFZ/Urbakiv3j0AcQfBQxvB4AxfAZc4xNhKD\nRX9w\r\n=ZaRV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEaCRc7pR1+nFgOPLe3MjaY1+sVKAk9JYPzdcxK6MEBAAiBse63k1YcfZXfL0BCjmFA38a1ryiBzPC71+1aho6JO6g=="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.7.3_1527345257486_0.7159904924632943"},"_hasShrinkwrap":false},"0.7.4-pre.f79924d":{"name":"ts-protoc-gen","version":"0.7.4-pre.f79924d","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.5.0"},"devDependencies":{"@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","chai":"^3.5.0","grpc-tools":"^1.6.6","grpc-web-client":"^0.5.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^3.5.3","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"14f35347d874cba30b9d0ff33bb5b318482c6292","readme":"# ts-protoc-gen\n> Protoc Plugin for generating TypeScript Declarations\n\n\n[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n![quality: alpha](https://img.shields.io/badge/quality-beta-orange.svg)\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations \n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n* Install the standard C++ implementation of protocol buffers from [developers.google.com/protocol-buffers](https://developers.google.com/protocol-buffers)\n* Install this package using npm, eg: `npm install ts-protoc-gen` or clone, install and build this repository.\n\n## Usage\nAs mentioned above, this plugin for `protoc` serves two purposes:\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n```js\nimport { UserServiceClient, GetUserRequest } from \"../generated/users_pb_service\"\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => { /* ... */ });\n```\n\n## Examples\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples)\n\n\n## Contributing\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.7.4-pre.f79924d","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-LLex2QkPcMUAXIurmLhD+3ieeQrtODXcaFwH3mau3e/MqgNSZLW87fUmE6/4mL2Bq2TqF8mFCEF9haHYpwpfjg==","shasum":"fef01bd14854de5c9f5b7cf5981b8e599fbbf159","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.7.4-pre.f79924d.tgz","fileCount":84,"unpackedSize":95259167,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbCXFdCRA9TVsSAnZWagAAEj8P/1tAJR522k9uz9+SzPFZ\nCoE33No7tKz9LLuz8FK0n6zhK9q6KpUZKQvZRP2ipJXm9noP1G5mwTCoqYu4\n/U/tm4Fh8L1vypN5i151cg9W8vyeOsb7ataXiHI2N/xOGhIo0WiAFOLmf3H5\n7+rR7b/7mX07oGZdUbf71G44x1zzBclyzFIXO/CPIxQ2w1hlogCfEZwl2sCT\ncBWL++FLuCL4SiTQ7xjmYLZORj/FozamWWhYdOgYJ8M5RRxioouZxs8JqYf6\n261ZgLpifwnx9/89Iw+Hz+p8MdZ2QBZEmZOyqLHpZfv1pM6psp/I+otQjcT7\ntOYsHDFAuBuh6gVJUTRkim1T1kk5MGb14g5l4FjRfrLyLNlyLmrhGOhVl6tU\nRcYt8YzWk5e8Srp8BOdkDquDrACRqCeNYGQuytyrAXpQWRHeP6YesbG/v6Yd\nE0ruzBI57poQxeCU2omfpH9omlCXOoMQFtNqeb+4iSoOTscbawWyjBqQTsmE\nRwXmzPry2NSCn8qI+sSD46yh4S3jpklv9j6RyStvN3K9oe10lTwfcQdKZnhV\nKY5zbSSxsVTG+L0AWRObZUDv/NJ7+yXIPZYiq8eupbM1d2LXihJZW2u0Igdj\ndfnBjDOH91J47gImMzCEKrwAt+W3P6G7cFdwodVJe6VMFkuZ7qtvdOdguL9y\nxV2y\r\n=T+XN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAykiMSiHEpAfToTqBcsLXurOWRUxW5kqtRGI7Nqx3ZLAiEAlhIbnkAitcYxuGHiQdbkDrymy49hnh91DQSmza3CzJ4="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.7.4-pre.f79924d_1527345498270_0.7678532548031238"},"_hasShrinkwrap":false},"0.7.4-pre.eabf953":{"name":"ts-protoc-gen","version":"0.7.4-pre.eabf953","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.5.0"},"devDependencies":{"@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","chai":"^3.5.0","grpc-tools":"^1.6.6","grpc-web-client":"^0.5.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^3.5.3","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"ecda2d72efd5476d7d5bd240f2c2b20155255fb1","readme":"# ts-protoc-gen\n> Protoc Plugin for generating TypeScript Declarations\n\n\n[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n![quality: alpha](https://img.shields.io/badge/quality-beta-orange.svg)\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations \n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n* Install the standard C++ implementation of protocol buffers from [developers.google.com/protocol-buffers](https://developers.google.com/protocol-buffers)\n* Install this package using npm, eg: `npm install ts-protoc-gen` or clone, install and build this repository.\n\n## Usage\nAs mentioned above, this plugin for `protoc` serves two purposes:\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n```js\nimport { UserServiceClient, GetUserRequest } from \"../generated/users_pb_service\"\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => { /* ... */ });\n```\n\n## Examples\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples)\n\n\n## Contributing\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.7.4-pre.eabf953","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-oR3RQtnOwfUsPNJQkdJZ32vUXMrp8Xf5ojAXr96UEn1demnkFF6Tm1Md8H/Z30zOr2icLNfj7xIGtJViw8cIdw==","shasum":"176c0cd1298799efdc25d310fd49d71a94fe65da","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.7.4-pre.eabf953.tgz","fileCount":84,"unpackedSize":95259181,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbCXGDCRA9TVsSAnZWagAAKkMQAKDrziyKp9Bp2CK5H6rj\nH3MlE07h2ougVirRj8WMy7fqI54LmH3wnix5HbA5vxX4q1zK/RJqgPdKHr6m\nNGal84Pu/H2aAx1I1SHKjtFOsZC3V+Xc6BkcRr38cULNrQfifsYUzXEfRGfE\nx+YU0sqG67IwiTJbLh8i2p/RP8h8fA1bFNtUXooG6wPvkLxnW8422mHVrPJ9\nQ/AQVRvQu+R6ffeugFGnz7QWdGBkHJXkg8bMsTfLlDR8K4xWR/mcDtEnSQt1\nv48cBWHgxbzAsnRVS5vMflh9v0ui2NuGuQAA3AFi6ZGekSoQUZpQGctlW3R8\ngX9B6rgn00yIYJFgPTMGLNmkVTafE1P2i1cw1jDqKKQiOu8uV16tfC4F2i/8\nXzaHX2/fDq0Z2LP6mFs2tw/XsaS0eX+vwR1jHKBumQNg8XxC64ly+awz4IAE\nGXUmoAdPrAGen9/ylPYUp7fHaGw8J0aY/rTjQmHg4sTPDBTDPHfd616GniT1\nbWeXKu4Jjsf0yPAgvnpNwvcvEqBrQxcyeowbfYYg7yQFuTufl5QdICO8lw7g\nTiMQs7e2/rJNBp2963QZx7VJBIJNJaNj3l8gswp+f4y8KcozFlaiG1BeOoeW\n0934nBkX0ajZart2082U4gpLWgc3xHgbt9tKJNUQDi34saOXmtPENiDcXW/Y\nGvg1\r\n=xZDx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGZjsyjoum4h4uRkPPHbjDX0i9VfdK3Yuu6nhNvrobpiAiB0QQo9JWuw2kO3nKY8vdWU0RNgJymeHYC10vQ16CkuEA=="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.7.4-pre.eabf953_1527345532274_0.6084475237350264"},"_hasShrinkwrap":false},"0.7.4-pre.4911ace":{"name":"ts-protoc-gen","version":"0.7.4-pre.4911ace","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.5.0"},"devDependencies":{"@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","chai":"^3.5.0","grpc-tools":"^1.6.6","grpc-web-client":"^0.5.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^3.5.3","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"79f1914d703f7c4f25abdda8b22337ec0d26abd3","readme":"# ts-protoc-gen\n> Protoc Plugin for generating TypeScript Declarations\n\n\n[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n![quality: alpha](https://img.shields.io/badge/quality-beta-orange.svg)\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations \n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n* Install the standard C++ implementation of protocol buffers from [developers.google.com/protocol-buffers](https://developers.google.com/protocol-buffers)\n* Install this package using npm, eg: `npm install ts-protoc-gen` or clone, install and build this repository.\n\n## Usage\nAs mentioned above, this plugin for `protoc` serves two purposes:\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n```js\nimport { UserServiceClient, GetUserRequest } from \"../generated/users_pb_service\"\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => { /* ... */ });\n```\n\n## Examples\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples)\n\n\n## Contributing\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.7.4-pre.4911ace","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-ZRA5zG3t5W0JVeu2DAo7xh7va2+MVd/cJOZioX91W8yzRI+UgotNHcvQjiCzXHkYnAU3SX2791dbaKMfX9Erww==","shasum":"e2488ac3350885e9e5d494c17b80f085ce77dc25","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.7.4-pre.4911ace.tgz","fileCount":84,"unpackedSize":95259181,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbCXJGCRA9TVsSAnZWagAAYmQP/jPf2QddkuAZ0B7N8va+\nM+tJwneOntvLvlwX6Dm3pSjTj2sg0aBLwVVJ6C3KRoae2Csini/ONXSCI+VP\nId0o9oj9f7hhu+ZGfDUaZBHmGu4gT3DM443+NZZfxek6P+7JddA5j0s3NMLA\nI4PgsKLYE7aICBb42F9sTWHfrIP1qCNFnQ2G9NRScAzT49lqJkqHrXvk5b8P\nAltd8sUvUHWVJGEGH+rCBh3psap/AOfDlX5jTjY0Zh3CX/BLC3sK12BtR/D6\nRNYC+NCFbBfhWYLwXaNi8Z3eCsriR+cXO7cIZ1LNhOxGF/UHxN++fUWP25ZT\nFS/1KJLQgI/s3f7Y2E+JAv7YU4YNbwjkmGgEsC5S8/xQ7EIJPO81Ox2LN+b5\nx6pBOj83Pe0fQkc4WVSI2XEk332dJLMUM1seZtdeeh/QmMiQsm9ieLdYc8zH\noI+2jPKqB8JyumFDzct717RDqFv7xyRN6i6E7cboe/smZPCgHvYfFdE4fNup\n6qFX0N4HFTNV5WwgK6Qx+nSZ5G8NhrDWebur7BkqJ1k1IYSi1EQe4N3GNQt7\nB+BQD6IY9tcQ7NSI3m06dNl3U9bbo66Ha6YmO0KiUrdFPXsiuVf+ZjiDAbD9\nd7+Xdq3x0a1EBsv/+s0AIDgB53u4W0jUTujgzzBgZP/SbKeJiikj5MwbJ92P\nh6Bv\r\n=SUrP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDJzp1zzEMqX9o6+Iidv7RRmmYKuilbJd7yPAi2UzTimAIgL2htatw0upg8SdUW0Chp2HGeQTjGvSqvnLwn/54YLOM="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.7.4-pre.4911ace_1527345731838_0.3815612282945329"},"_hasShrinkwrap":false},"0.7.4-pre.7247cc3":{"name":"ts-protoc-gen","version":"0.7.4-pre.7247cc3","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.5.0"},"devDependencies":{"@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","chai":"^3.5.0","grpc-tools":"^1.6.6","grpc-web-client":"^0.5.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^3.5.3","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"64c5b4c3cc7df160856e5e2691c410e4b245a6d2","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations \n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\nAs a prerequisite, install the standard C++ implementation of protocol buffers from [developers.google.com/protocol-buffers](https://developers.google.com/protocol-buffers)\n\nFor the latest stable version:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n## Contributing\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\nAs mentioned above, this plugin for `protoc` serves two purposes:\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n```js\nimport { UserServiceClient, GetUserRequest } from \"../generated/users_pb_service\"\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => { /* ... */ });\n```\n\n## Examples\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.7.4-pre.7247cc3","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-wO57XOGlLbp1FuJQYyulftRPFkwXuQgxHSb2TC0JxIV7sEIV6PK8KrL4UNSQMHEcbHLbbFhmjf+EvUhqjIfi6A==","shasum":"85cffc753bb682c8d7c5915f195d244f6148db5f","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.7.4-pre.7247cc3.tgz","fileCount":84,"unpackedSize":95259276,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbCau0CRA9TVsSAnZWagAA1LEP/2M4wsovY93BQZ6cszIg\nEzcsIrSM1UOdWIIJhLgWsinS+CQjTWPyZ3XMKfakQS/AD1wbM4s79VqfU3Fg\nirV9PM6JBrwUIzSiKgpBlAliR7EydUKjPjRn/i7c9hAnX5PYEFLtVNXtB2l2\nrG5kwTzZ4K4XfRHAiiRCpat1o138jFo01BOdaCuIkQ45XaeLmNHR4MdWiC3u\n+74u3eZ0buL/aklFI0UoLlG8TKY7Rncxz4Po1N2tyZK5EHcp9Uld0eSfO25v\nzIz+3E/dExzra2FHPlYmrcR7+j4JlP/c+mc71Zj7x7vnRo7dhrErrj92OVPY\nGr8dh8XReWceTE9DVLzFieEJRw4DlTyvkZZa7q5b/GqvJK4W1qa+r4JsxyVU\nJkDjH9xUfUQkE21g3kqfas7eLCX99LXqbZDJ09f8JExmGO4qqKCxpmX5fp7f\nUSo2w/e5KZzuDHdAw+B7l+NcVfH1u9HLuyoJX13JGeMfLJkVLWj1z4f+5dVI\nAGj2XDZppDT5/BPxS/LC47F95XYS6dHuw6ZZk1nYpfoxXYsnTocx5b1BriD6\n5I9bHS3uc44CyOkfEMVOkksAD0AfbfqIeatUH5WtyEcl9IV9T55kA2noK1PR\n+schqtJbTUoVgYPSwcwh6VdD7z/J6cMZtBnWPQhxEDQrWEgzvFW+RsSe8n8Q\no4Nq\r\n=Fjty\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBi3mI5bam7l2TyXiPh4vc1bq6pAJSsadyrPv/OjSm8gAiAclALESvK0TSqjA4c1ApumXv1vviz4qDS4fvX8vict0Q=="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.7.4-pre.7247cc3_1527360433556_0.7120117247655509"},"_hasShrinkwrap":false},"0.7.4-pre.c79cabb":{"name":"ts-protoc-gen","version":"0.7.4-pre.c79cabb","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.5.0"},"devDependencies":{"@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","chai":"^3.5.0","grpc-tools":"^1.6.6","grpc-web-client":"^0.5.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^3.5.3","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"4d4fa8118416b0d71c5de5338bef8291b2540605","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations \n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n## Contributing\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\nAs mentioned above, this plugin for `protoc` serves two purposes:\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n```js\nimport { UserServiceClient, GetUserRequest } from \"../generated/users_pb_service\"\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => { /* ... */ });\n```\n\n## Examples\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.7.4-pre.c79cabb","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-cl9c0T6LraFWdefbOIGGhUi5bhrZAFh+6o/74jooHT+8ePHLWQHi1gywyDpuFsiR4WXg45f/DpNeovNzictU0w==","shasum":"f181e6cd3436b7b26bd8f1fbf7d147fa768c4b5d","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.7.4-pre.c79cabb.tgz","fileCount":84,"unpackedSize":95259437,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbCaywCRA9TVsSAnZWagAAIPgP/iRAeeOmPqw5mj7nTtOM\na2iw4HRDzU3la3y/kFV7NH3ijuuhazYDRTQSOz1w3JzInOBtjYxEn+XelY5L\nxMGuheGKrJjRnGluduJGalpSv2HE/H9PpY3QUR+y75U4lJ44bUfIt6uJ+Jph\nR88qS4MwM6xTm83Z7briu83ld6bgXUSaHTy+0wFb9Ly3PQIfMenjPV6qbQAQ\n0S5G5pZ9OdBOMGU3pJDRd9HMkS/GnHlLdqlPtAgpUtSMEAneC346QUeYA9LX\ncxij/WrnYANX8ij4QzZWqjNoRgmIhZiQAnincjWWstYf70qYryPUOq4S427Y\nqyYkBbgHFzWQlidA7irMY+SzmMmDQMpGGYag2htho37zUjhjStc9iNv+4CLu\nJIMKeVokHOMfZe3lyZUfFg5/e17XYV+iC8hAIVYIX6udfqdcD1WhuDHARoLw\n9sT730qT8nbVAp3bsgudTXIuqkiyiZSji9TYb/CMt5nge+KBDzGTlwwC6r/5\nUc/TVNsKdBPUuDTrsjoGNAmLYLw1cKyVNCH8zK4Aab/gqvU8pUKHD98r5+az\nnJXFWTdNXsrbAq/UHHf6xjGo4VzDeM59nI/pY28RZCyUekov8Z2bGI4R8drZ\nl4TMXK/ypn84RMlbfgDw8vzqbhqDLglz3IdKLINEBNGAQy794K0FqS4VHcJT\nDjYO\r\n=XHiK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCE3FGqgBazvIHNnwLqFcwUmdZWLi79g/TwKHaa9bbZ3gIhAKZiKy2+VSSHZL8WR/Z7fSxQBIlnP/Zs7H0R7GE/H3Jr"}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.7.4-pre.c79cabb_1527360685620_0.48466146418249956"},"_hasShrinkwrap":false},"0.7.4-pre":{"name":"ts-protoc-gen","version":"0.7.4-pre","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.5.0"},"devDependencies":{"@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","chai":"^3.5.0","grpc-web-client":"^0.5.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"dd6d3d3b1fbe4ef819f9c9f1fe7ef0d8337d4bc6","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations \n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n## Contributing\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\nAs mentioned above, this plugin for `protoc` serves two purposes:\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n```js\nimport { UserServiceClient, GetUserRequest } from \"../generated/users_pb_service\"\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => { /* ... */ });\n```\n\n## Examples\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples)\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.7.4-pre","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-Snwd6HXzK57Esd2+Ehjxz84nRUuJsnAcMh0dWEslchdu0Q2QI8OfyPKUHsAsjhqnzrOcGM85mEhK1Dwob62g3Q==","shasum":"7dd098e905f04191fb60fd086629118ea9b25fa9","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.7.4-pre.tgz","fileCount":84,"unpackedSize":95259401,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbDFkCCRA9TVsSAnZWagAAJVcQAJGbknikJIefGF/TnCHj\nUxNg4novDlSqyFqTqIp+AxNdkEHnuNbfqszr4bBO5BHzdODEOAh0rpYNVQSK\nl3uVmen4QLBOzsxtaqkLHyeQSyaUiQLwmSTWRREryr4SZbWOGJ22u43Sfm+1\ndgK9MgSB5WSUpi79L3GwNBI8Mfy6hp7IsRaUguLC5ls4m+lOaVOuXc8IZmzn\ngDAdOqkEIY5XlYRcZPOzZOJwmf7FI4+Zp5bxJp7XN1LciuUlWL3HD3h1Fa78\n7RRBNDbeGbjsVkL3lrZWaEHRzvyj5voRK8rYY4x/WOPGKtcQSjawF9L869b+\nL9TioMdlg+OgWDCYb+2L0TIofp2Z0qPYfNpE7MiYsKFYsYyIUKTQQNRuyhOW\nUwEeyYYwxeIu9kCJYmxSTASEaxzgBZlaumiDQkf3hzVMPdoJ9zKBLB9I8VjI\nToN1/vmRQhOuXVtbsg5ZHt7FWXjQiFHd15kbIFXiEZhVaj/vC/xG6G8QSJG9\nfQRhCQW+4Uv18v0bTpTOhPW6IfJMLIXt3M3YLGeTeAxnJr8xrsGRJU3Heu14\nLjOLP8M1Pm8HooOBIx1eJWD3tQn8WH8k8CBcjt7J2weQFxOeEsFQV93GsBcl\n37fUb1wYthx4ntqfXvcyCOQ71CgDj+VzpiIJ2HmQqOm2tt8Vg5FtNo3tWQCO\npqfG\r\n=8Jff\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD1+0pNwMe03zUuTwQYEjzF9v40jWhxMjUP5sCJsy6PdQIgRobaXgynERmETebMcyAi4nPkSyTN2g15esIxQRhwzZw="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.7.4-pre_1527535869979_0.5571626935452769"},"_hasShrinkwrap":false},"0.7.4-pre.54d261f":{"name":"ts-protoc-gen","version":"0.7.4-pre.54d261f","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.5.0"},"devDependencies":{"@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","chai":"^3.5.0","grpc-web-client":"^0.5.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"0e28c215421efe41871c81db2e8353649383fa5f","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations \n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n## Contributing\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\nAs mentioned above, this plugin for `protoc` serves two purposes:\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport { UserServiceClient, GetUserRequest } from \"../generated/users_pb_service\"\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => { /* ... */ });\n```\n\n## Examples\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples).\n\nTo generate the examples from protos, please run `./generate.sh`\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.7.4-pre.54d261f","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-Nr2frzlsi5hZ7t22DHWwdllk8nahnJi5duQRoGNyHRfjBPqGBuMJLuB6uORIeX6NsM2KWOHUwzvJJFSi3CFWqw==","shasum":"d54fec1a4ae21af0976676f2cdeba2460ecdef50","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.7.4-pre.54d261f.tgz","fileCount":70,"unpackedSize":89641362,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbDveJCRA9TVsSAnZWagAAg64P/1D1iic1fBFCX2hLNyxG\n9DMES5Ri5WKvQcZS6moDlcNDsenAg1X6R+nTFfsI1BScmbn66twAOjWtR6NJ\nZ6R2wtutSD9hxbEBAou4ewN5RmE88Bh6IudqMUKK0gw5Eq3zyTDbH+SoK6Rn\nNERZVenQ8m6Xv8MkDkEOsdBuEAMDuuxj0/wDQlXYmB4weDk5gWubmgn+QiMw\nMY0mxFu3kuj/co2UL1sNVXPQIlB4G8hExnXUpUAy8Sp7IYiU6LMJW1W1pgSx\nq8Gv/YLsSK5un425LniFttcVvYDHoShCibgI+/GpNFwfQGTfGGjaK1gtWKzi\nYU/VV6vw6DQ6XORaSi+SJzL2URIlFRkW/ahGfmI5VVcsqjW/TZsGIFjmsOy3\ngCaM4+RkotNVuBCsSpuBPHNsWFEAJRBJkRxFxIueT6qjwjpR2L+gP/vlOQBF\nccjIGGw48UOyz7ML8A9+8sLAac53We+RoujmQhFn0/+bF/SemIEOcznCT12I\npRBF1oLcyO+xjDnG4IB+bYd+qteMZbGedt56zBM2j+JbrUI/fUDRLfaAIfjB\npWS/EqKl6jqOPm9atIaIK90VQKChs3yoDj+rxk18KJh9O+8XYQxvNVw+N2YS\nGQ60hul3OLgJv8Nwf+6fUa9AfuEOzEkt9tHCr0mDhq6RzQB3Zw1IiGPTS/yd\nppMG\r\n=oo2e\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBiDIS6MX4QNjXP6pFDoePJE44IOZLKKgIIuy5Vb75HaAiEAvRaXepNnKJoLzY2jxaKTH40Zhg3+a33i6W0e0UCMNbk="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.7.4-pre.54d261f_1527707523712_0.762670371755954"},"_hasShrinkwrap":false},"0.7.4-pre.05c52b8":{"name":"ts-protoc-gen","version":"0.7.4-pre.05c52b8","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.5.0"},"devDependencies":{"@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","chai":"^3.5.0","grpc-web-client":"^0.5.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"0e7ff9b8c04812a5275c8a40fe1ed956efa6117c","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations \n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n### bazel\nInclude the following in your `WORKSPACE`:   \n```python\ngit_repository(\n    name = \"io_bazel_rules_go\",\n    commit = \"6bee898391a42971289a7989c0f459ab5a4a84dd\",  # master as of May 10th, 2018\n    remote = \"https://github.com/bazelbuild/rules_go.git\",\n    )\n  load(\"@io_bazel_rules_go//go:def.bzl\", \"go_rules_dependencies\", \"go_register_toolchains\")\n  go_rules_dependencies()\ngo_register_toolchains()\n\nhttp_archive(\n  name = \"io_bazel_rules_webtesting\",\n  strip_prefix = \"rules_webtesting-master\",\n  urls = [\n    \"https://github.com/bazelbuild/rules_webtesting/archive/master.tar.gz\",\n  ],\n)\nload(\"@io_bazel_rules_webtesting//web:repositories.bzl\", \"browser_repositories\", \"web_test_repositories\")\nweb_test_repositories()\n\ngit_repository(\n  name = \"build_bazel_rules_nodejs\",\n  remote = \"https://github.com/bazelbuild/rules_nodejs.git\",\n  commit = \"d334fd8e2274fb939cf447106dced97472534e80\",\n)\nload(\"@build_bazel_rules_nodejs//:defs.bzl\", \"node_repositories\")\nnode_repositories(package_json = [\"//:package.json\"])\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\ntypescript_proto_dependencies()\n\ngit_repository(\n  name = \"build_bazel_rules_typescript\",\n  remote = \"https://github.com/bazelbuild/rules_typescript.git\",\n  commit = \"3488d4fb89c6a02d79875d217d1029182fbcd797\",\n)\nload(\"@build_bazel_rules_typescript//:defs.bzl\", \"ts_setup_workspace\")\nts_setup_workspace()\n```   \n\nNow in your `BUILD.bazel`:   \n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nfilegroup(\n  name = \"proto_files\",\n  srcs = glob([\"*.proto\"]),\n)\n\nproto_library(\n  name = \"proto\",\n  srcs = [\n    \":proto_files\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"generate\",\n  proto = \":proto\",\n)\n\ntypescript_proto_library(\n  name = \"generate\",\n  proto = \":proto\",\n)\n```    \n\n## Contributing\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\nAs mentioned above, this plugin for `protoc` serves two purposes:\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport { UserServiceClient, GetUserRequest } from \"../generated/users_pb_service\"\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => { /* ... */ });\n```\n\n## Examples\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples).\n\nTo generate the examples from protos, please run `./generate.sh`\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.7.4-pre.05c52b8","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-DAryyUhgq5ctO/jPU5WNUB3pLMXub1vxwYjucdh/nOl/cnYaXeLRrQBua0mgzNoJubn2MUW8D08LPUHEFwGu5g==","shasum":"bb9fa823d9b2f4dbf48c8e154eb807eb2843caa6","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.7.4-pre.05c52b8.tgz","fileCount":74,"unpackedSize":89648940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbHWE7CRA9TVsSAnZWagAAeo0P/19kV+o7U/WKgKg+jzio\nz2MuAZnmD6m9Oti0btdw3cufYocEBzElLh5Y06/72iNhtDQauiL2BECis2md\nTD0zHvPHXxYM70BIXtUKjPPLtQwXfo91ZdVCS1ns9PIu/LyaCqJGc4PfQdEJ\nAIWP02pawMJPV7bayWUxl17oAeOAHOONXQZxfr6mfwyb9nldseM0jBLh2M7b\ntOhaGrISuOzUMUm+w+93qeozqGnTpm1pM4AELcBBo60bvbglti3hnG2fojsH\ngxdjqeLN+iGZTE5vLYTv4n2zd+VeXYyfjJTan6wnUCTJq2INSAkPyaX9uRgL\nY7GqddjPLkfIMZ/34/vT5tWL4WFEye7B54jLUOrjM0ydRu67VwBSrSVEmnLc\nPU8MFS+P325+C+R/FFXjkPf4S9yl38T01y7QPI7wCNn7+uZgkSBaz2+RYCw0\nxckTujzy9EqXPVKCgQ4P66mFQfAjOtJrA8Jw529nDX9IKXfmXcSrAqkYowLG\nOoli7HS+Hq9yfwtYA0+7zOLSHrkwYOd7wX718d2ybBcrUIIcpH/VdBTM+qdQ\neVeqb2B03ik8yAWpl5uajMIPDJ+qyrq6W6qWd6rHSJlQYHk6uXCkRGBxk8+k\nILRdpWon7T400yJR2P3eFsfpdjjmXvwQEJirVB2p01Liarg2ojr0JWnDu9lW\ntYIO\r\n=Zul+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCagRRYEeI5m+Dn8R6zCIrMyQ/xbxQLqJ5K6MvbTtwvTQIgaHD3bTDfuunJRdovUmurYLHbbzBd6apj2xyUscQP36c="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.7.4-pre.05c52b8_1528652088308_0.08538291109028062"},"_hasShrinkwrap":false},"0.7.4-pre.53aa49c":{"name":"ts-protoc-gen","version":"0.7.4-pre.53aa49c","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.5.0"},"devDependencies":{"@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","chai":"^3.5.0","grpc-web-client":"^0.5.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"93cd0a3009607da3cb66683e72a5362359d9c11d","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations \n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n### bazel\nInclude the following in your `WORKSPACE`:   \n```python\ngit_repository(\n    name = \"io_bazel_rules_go\",\n    commit = \"6bee898391a42971289a7989c0f459ab5a4a84dd\",  # master as of May 10th, 2018\n    remote = \"https://github.com/bazelbuild/rules_go.git\",\n    )\n  load(\"@io_bazel_rules_go//go:def.bzl\", \"go_rules_dependencies\", \"go_register_toolchains\")\n  go_rules_dependencies()\ngo_register_toolchains()\n\nhttp_archive(\n  name = \"io_bazel_rules_webtesting\",\n  strip_prefix = \"rules_webtesting-master\",\n  urls = [\n    \"https://github.com/bazelbuild/rules_webtesting/archive/master.tar.gz\",\n  ],\n)\nload(\"@io_bazel_rules_webtesting//web:repositories.bzl\", \"browser_repositories\", \"web_test_repositories\")\nweb_test_repositories()\n\ngit_repository(\n  name = \"build_bazel_rules_nodejs\",\n  remote = \"https://github.com/bazelbuild/rules_nodejs.git\",\n  commit = \"d334fd8e2274fb939cf447106dced97472534e80\",\n)\nload(\"@build_bazel_rules_nodejs//:defs.bzl\", \"node_repositories\")\nnode_repositories(package_json = [\"//:package.json\"])\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\ntypescript_proto_dependencies()\n\ngit_repository(\n  name = \"build_bazel_rules_typescript\",\n  remote = \"https://github.com/bazelbuild/rules_typescript.git\",\n  commit = \"3488d4fb89c6a02d79875d217d1029182fbcd797\",\n)\nload(\"@build_bazel_rules_typescript//:defs.bzl\", \"ts_setup_workspace\")\nts_setup_workspace()\n```   \n\nNow in your `BUILD.bazel`:   \n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nfilegroup(\n  name = \"proto_files\",\n  srcs = glob([\"*.proto\"]),\n)\n\nproto_library(\n  name = \"proto\",\n  srcs = [\n    \":proto_files\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"generate\",\n  proto = \":proto\",\n)\n\ntypescript_proto_library(\n  name = \"generate\",\n  proto = \":proto\",\n)\n```    \n\n## Contributing\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\nAs mentioned above, this plugin for `protoc` serves two purposes:\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport { UserServiceClient, GetUserRequest } from \"../generated/users_pb_service\"\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => { /* ... */ });\n```\n\n## Examples\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples).\n\nTo generate the examples from protos, please run `./generate.sh`\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.7.4-pre.53aa49c","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-n5YYuW8WAl4G80UBRL69Sb7+q+VarUB8Ewxo9Nxrf8rlAL73wmxKgp0H1GbejXTWZHuB/tuA7yGuCs0Ta0U2JA==","shasum":"1e30bd6353de1783bce4df7c5cfa74a7a327d0be","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.7.4-pre.53aa49c.tgz","fileCount":74,"unpackedSize":89649107,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbIWjgCRA9TVsSAnZWagAAtjkP/2yOS8nVCIz9yXaTy1Hn\n07+lh/CXL+1q72/WPaNy+U5YSaP91o3H6bELaGBqD9Lq/1+IWHgK/1nXKX8d\nIIdZISfuyUNE3+Jmt+TjwCHzONlGuUdg0HijDaw09+cQR3nxRrS3RDptPXDs\nfThSJiXovL1jBf2k0sZWrXk8jcAWdhKRRdxf3pckWTy9CYsGNwszTjvwtKHR\ncjLkdARfTYZf8WzS+a2MysBqK4OddcPuiU12lCdXQmhRKpLD26ukLamNmJlS\nM/hk/+hUGN/zRtd4lSwr+TBXrKd4inwYJxauypQwspZMtQzyTiWWLnqZw3ta\nJhCF4dBovelTUN8jLFjAD3P17B1nA4GwJFIBn6yuNq54O65W08WJS3yz8/CO\nOkoJt4h/M0z9f0737/9J/En50YUr7E4fbGClMcOQVPzVeetIC+XUBVJGEJ4R\nKWKfaQj1VYYe7uzq5l7854LRQORuFo9SaO3dpQKoC/j9pVrEnjz4P8U5L3i0\n38ycA7TbVKZWWvYiImZCpR7AXK3I7tBDcdIoSa/BHM4NOxMl7sm6UykIzxss\noV2nGJ3kGviO6DMXPU7kiGcV54qx1d9YMeGLdBW73PUqHbXUxry4YXQosWNL\nigmBskuckTXxWZcyxR8sWfv4nE78lL9XLUm0OSeBSXK2FLllO3NDYiBjFnxE\n0DVf\r\n=dHyM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG8fs705/2uQwc+2uGwWdu7Rim0TVOVBaBcT4UGn2ToLAiEA79H/ElZMMAMpqbm/XgkkXVICpB1HTzEpcFrOC+pdu+M="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.7.4-pre.53aa49c_1528916189067_0.8813279240986056"},"_hasShrinkwrap":false},"0.7.5-pre.64914b2":{"name":"ts-protoc-gen","version":"0.7.5-pre.64914b2","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.5.0"},"devDependencies":{"@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","chai":"^3.5.0","grpc-web-client":"^0.5.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"4ba6534b7c90c557b1bfb242be5935ff0d9afc10","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations \n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n### bazel\nInclude the following in your `WORKSPACE`:   \n```python\ngit_repository(\n    name = \"io_bazel_rules_go\",\n    commit = \"6bee898391a42971289a7989c0f459ab5a4a84dd\",  # master as of May 10th, 2018\n    remote = \"https://github.com/bazelbuild/rules_go.git\",\n    )\nload(\"@io_bazel_rules_go//go:def.bzl\", \"go_rules_dependencies\", \"go_register_toolchains\")\ngo_rules_dependencies()\ngo_register_toolchains()\n\nhttp_archive(\n  name = \"io_bazel_rules_webtesting\",\n  strip_prefix = \"rules_webtesting-master\",\n  urls = [\n    \"https://github.com/bazelbuild/rules_webtesting/archive/master.tar.gz\",\n  ],\n)\nload(\"@io_bazel_rules_webtesting//web:repositories.bzl\", \"browser_repositories\", \"web_test_repositories\")\nweb_test_repositories()\n\ngit_repository(\n  name = \"build_bazel_rules_nodejs\",\n  remote = \"https://github.com/bazelbuild/rules_nodejs.git\",\n  commit = \"d334fd8e2274fb939cf447106dced97472534e80\",\n)\nload(\"@build_bazel_rules_nodejs//:defs.bzl\", \"node_repositories\")\nnode_repositories(package_json = [\"//:package.json\"])\n\ngit_repository(\n    name = \"ts_protoc_gen\",\n    remote = \"https://github.com/improbable-eng/ts-protoc-gen.git\",\n    commit = \"05c52b843edf9420be3a9549d01352dfeff76a5e\",\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\ntypescript_proto_dependencies()\n\ngit_repository(\n  name = \"build_bazel_rules_typescript\",\n  remote = \"https://github.com/bazelbuild/rules_typescript.git\",\n  commit = \"3488d4fb89c6a02d79875d217d1029182fbcd797\",\n)\nload(\"@build_bazel_rules_typescript//:defs.bzl\", \"ts_setup_workspace\")\nts_setup_workspace()\n```   \n\nNow in your `BUILD.bazel`:   \n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nfilegroup(\n  name = \"proto_files\",\n  srcs = glob([\"*.proto\"]),\n)\n\nproto_library(\n  name = \"proto\",\n  srcs = [\n    \":proto_files\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"generate\",\n  proto = \":proto\",\n)\n```    \n\n## Contributing\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\nAs mentioned above, this plugin for `protoc` serves two purposes:\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport { UserServiceClient, GetUserRequest } from \"../generated/users_pb_service\"\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => { /* ... */ });\n```\n\n## Examples\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples).\n\nTo generate the examples from protos, please run `./generate.sh`\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.7.5-pre.64914b2","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-IzN5s47//1agl5xXsL3UujZPFzc7g+y0ZyQmyNrpnR/WcfIj3dhyhNvVFTDaFesSvsa/ZIulnxvJMPjxn8ccDw==","shasum":"4c0dbe436ac1da73db67126d67e9565af1c3c42b","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.7.5-pre.64914b2.tgz","fileCount":74,"unpackedSize":89649986,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbT0/bCRA9TVsSAnZWagAA46YP/2alKQgpoHnxEB3H/ASB\nUQJLUyjZ/s1BXYPyTbOSWzjKMxzuZrKQmSOVmWZYhIwDCNaViYVrV3iD5iNV\nLlFkKORhXwEijeGbB5BzqkJveTaXkExXey1psr3E+qkfKeQHhe/yEy8QEdBy\naKv+KBQRsYY1ILCcTnFgFn4RxmicwL0SwBL9m9nFcgEZ9I5pNqamsd5+ypWg\n9g7/3b3Y9csiizFLCfxFJz+uywDNJ66E3X8x94OfMZ3n1P2umme2n1SVqmmB\nhiqQAaCBD2/iq8fX6+ReLRF71WYvu2LOVV6z6AzEDZfm4Y8KjUvfz5yuXFrO\nU0FZJYhJCAwfIMfzG+TEpOUMJMSTKH10tKyykBjl1sOorBjE1Yqa0Smkws+R\ntFDRDiNPQ11u8rDItC+rVaATrvZoF/zaVurAi1wxOe+8QdpHg3bhZ+2P/58x\niy3J4pTlPOifpVufqpr6ImUjW1QluLNYn8NV4wFGhunO+kI4N8+974FbKV30\nZA0VyYBQrgVO0u1erA/xOMz0lBD0OWxp47TkF2cWYE5cynZXG5NvJEc7JgGc\n8ZMtGQhw3BbaKc05kpd9GnAvm6JrJwJ5Tl7JjPlNWWB+ydyKUGqIVHXzHvO8\nSOSolWshvldkQxaEhKyVzU3nVy0S/89CBj5HnVXePBDGCCM9/AVT+KHMxxsT\nS8N2\r\n=HkN9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD+XM4opRK40mB7xhLNGt33HOP53/V+G5+r7qOuEOyctwIgBJE8SW/gUTqeJ5MSqX228A/t+p4klhkk010gv5OYmSQ="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.7.5-pre.64914b2_1531924441684_0.6187404774762428"},"_hasShrinkwrap":false},"0.7.6":{"name":"ts-protoc-gen","version":"0.7.6","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.5.0"},"devDependencies":{"@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","chai":"^3.5.0","grpc-web-client":"^0.5.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"10c3fc9cdb01e55d93c51e146a9b2e3c759911d2","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.7.6","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-PW0kzZT3jwqh1VE8Lijd9AOV4o1g9lUlHo4yyb/KDvMN5CZLyAlng/chWWyxYpGLxKY+8NsWDIqkeI7w2yRoJw==","shasum":"e3da534fc498b5304e1a8416f278187bf9fbc91c","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.7.6.tgz","fileCount":74,"unpackedSize":89650061,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbT6ZbCRA9TVsSAnZWagAA0XwP/03SK7M4ADf93tTFNjBe\nAKhUeTno8gCVLf4+VCnzeayJ26jDzJMYoCvPhZK2gVTOcA0yCRSt9T7TsnHv\nYx6FzQA94+iUu6dYj+eSy6KCwHe/kvEQhjKisQThd77rUQYtkCeegWXB6pOx\n5vnf7oszKCnXL092z8EeK1oIN5K0GPIGktWILI0y/l4NwLseumZggwLA5/bG\ng8IURTWynCTkcfXGUdT93HGCtIAXPsuT2VYtg/0VTVqcmaXStjPOf2hl+X2e\nQjKn7ztfiNVsbgVVDAZbP7xcB7V9nlziIg3io5k/KrpH72D1Z5W89O8NJjnt\n2UAvaAHSqfPoiK6IVaaNxmwyIGF1uWKKhhC+YbuAfpTAV2Js6JFOBO34R9J8\noEj+xz1bCIfo6d68vdSdmgQwjy+X4KHnE5BkxhXjoHF1IJAW6/nONnWF4AMo\nJ9Ac7Dr9m2z+mPKjrrSF9UrrBCBFM6PZcmFtCUDda06lYvAb3JqE5Z2EOo/9\nxXeIEdRK25NCBnaXyBTwLqXqCi3ivryjpd/7LQ4yZRdj1sm/J4FEQ66ymLw6\nMkEz5wA/84+YjA1DE4umGfkl3MTdQ97dyN3r635oa5gagh8dXlsOkzJCf0q9\nYRW0pOc2r6Nyv6AJL3RDzY9RfVURuOgbnZoCkP4qpkpCPfZl3SEblYe8hyiC\nRcXh\r\n=vjz7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICmVywwO2+oaF+gzFdZR4H0ZsOGuNVXrlDLIjDpQXkExAiEAvFz3hafZfKj9iJDGBvFAic+RyrpLwj46fRPfksta/Jk="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.7.6_1531946584802_0.2816063839968115"},"_hasShrinkwrap":false},"0.7.7-pre.50bb30c":{"name":"ts-protoc-gen","version":"0.7.7-pre.50bb30c","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.5.0"},"devDependencies":{"@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","chai":"^3.5.0","grpc-web-client":"^0.5.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"48b34030c54421ca6587e7559f1cf82260eb30b0","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations \n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n### bazel\nInclude the following in your `WORKSPACE`:   \n```python\ngit_repository(\n    name = \"io_bazel_rules_go\",\n    commit = \"6bee898391a42971289a7989c0f459ab5a4a84dd\",  # master as of May 10th, 2018\n    remote = \"https://github.com/bazelbuild/rules_go.git\",\n    )\nload(\"@io_bazel_rules_go//go:def.bzl\", \"go_rules_dependencies\", \"go_register_toolchains\")\ngo_rules_dependencies()\ngo_register_toolchains()\n\nhttp_archive(\n  name = \"io_bazel_rules_webtesting\",\n  strip_prefix = \"rules_webtesting-master\",\n  urls = [\n    \"https://github.com/bazelbuild/rules_webtesting/archive/master.tar.gz\",\n  ],\n)\nload(\"@io_bazel_rules_webtesting//web:repositories.bzl\", \"browser_repositories\", \"web_test_repositories\")\nweb_test_repositories()\n\ngit_repository(\n  name = \"build_bazel_rules_nodejs\",\n  remote = \"https://github.com/bazelbuild/rules_nodejs.git\",\n  commit = \"d334fd8e2274fb939cf447106dced97472534e80\",\n)\nload(\"@build_bazel_rules_nodejs//:defs.bzl\", \"node_repositories\")\nnode_repositories(package_json = [\"//:package.json\"])\n\ngit_repository(\n    name = \"ts_protoc_gen\",\n    remote = \"https://github.com/improbable-eng/ts-protoc-gen.git\",\n    commit = \"05c52b843edf9420be3a9549d01352dfeff76a5e\",\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\ntypescript_proto_dependencies()\n\ngit_repository(\n  name = \"build_bazel_rules_typescript\",\n  remote = \"https://github.com/bazelbuild/rules_typescript.git\",\n  commit = \"3488d4fb89c6a02d79875d217d1029182fbcd797\",\n)\nload(\"@build_bazel_rules_typescript//:defs.bzl\", \"ts_setup_workspace\")\nts_setup_workspace()\n```   \n\nNow in your `BUILD.bazel`:   \n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nfilegroup(\n  name = \"proto_files\",\n  srcs = glob([\"*.proto\"]),\n)\n\nproto_library(\n  name = \"proto\",\n  srcs = [\n    \":proto_files\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"generate\",\n  proto = \":proto\",\n)\n```    \n\n## Contributing\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\nAs mentioned above, this plugin for `protoc` serves two purposes:\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport { UserServiceClient, GetUserRequest } from \"../generated/users_pb_service\"\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => { /* ... */ });\n```\n\n## Examples\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples).\n\nTo generate the examples from protos, please run `./generate.sh`\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.7.7-pre.50bb30c","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-0Nd7b+B+MLIIdF7Nzk4cnxeFzeKJCSxKIubeOScYIB75k+qBBPAVjh5CY/o8/pjwiJVy2jAngLqi8CT9eOnuRw==","shasum":"e2d148e5b5c34921bf5a81353b427046191f1873","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.7.7-pre.50bb30c.tgz","fileCount":74,"unpackedSize":89650087,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbT6bICRA9TVsSAnZWagAACUMP/ijqfcOifXQHvE2jzYNY\nU8o358lMya7xL267u4TIS4dmh3oriA0TSUDFxf3orx1ECpV64QhYl8dp9St6\nUzDJGRGDTSNoroy1xEze5SVUlwpjtvdFoLC0fIWt6dmDsP01MAFN/h/AGzQJ\n/xxZo2xIrSvzvew7lV1TWrB/qWciHWPfFTAHkt0DSF3BFC0B0iSJF+crDjcl\nGOjoQfhOaaSykVBpsteV9ioTl34sB7OHBcRhOL4wPlBfM3ZnmhVgUya9vbav\nw25pGzQSY/fw35J0fF6UwfQgsGbDD+UT3a2cbt35VCY8Eb0n4Wb6ul9Hks5g\nsUSxPWaizyKUUzJGXPLS4l/wTZE/Qy0KwsstPBi1woGuQORg8JULsS1/YEFH\n7j0krXP5OXSVBoM8+Rh4MArfFsBHCOvW7+bvJ3Cg3q0+nhIaRqfMRCfdkWxp\nOeZ8LCHYJ0XqYftDu3BW4+DfQTOSMrg8q1oQBS1pyHlOuZLBwjg9TSRXkiRU\nQ8rR/GE7wa7S0jXWo12iwVLIQGDUm3BUTt1cuADGpb57NB3XtxO7B8KpJoYg\n+BNqpDxcK7zXFFwWnjNeHssVzWddekOw7aiElDe3Uonq9qtfem9bbE2ypObW\npX0g6CcFkDY80Hu4a+0QhZJmsbyDGLdF3s9iTqZ4p+BIqyCP+Q5xajXm8SMn\nz7Y1\r\n=hN+M\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEn1q24UBhjJBczTAQ8xfzzlLT4PhLASs2boEIAw9w5kAiAyPCGAdSTaWUbAtsSEEjY8+uq23Cd6KQiPC6cT9ze/4Q=="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.7.7-pre.50bb30c_1531946683636_0.8524925989747869"},"_hasShrinkwrap":false},"0.7.7-pre.24fbad6":{"name":"ts-protoc-gen","version":"0.7.7-pre.24fbad6","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","chai":"^3.5.0","grpc-web-client":"^0.5.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"54593cf2dba646b3630654c894b7cc31de361d09","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations \n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n### bazel\nInclude the following in your `WORKSPACE`:   \n```python\ngit_repository(\n    name = \"io_bazel_rules_go\",\n    commit = \"6bee898391a42971289a7989c0f459ab5a4a84dd\",  # master as of May 10th, 2018\n    remote = \"https://github.com/bazelbuild/rules_go.git\",\n    )\nload(\"@io_bazel_rules_go//go:def.bzl\", \"go_rules_dependencies\", \"go_register_toolchains\")\ngo_rules_dependencies()\ngo_register_toolchains()\n\nhttp_archive(\n  name = \"io_bazel_rules_webtesting\",\n  strip_prefix = \"rules_webtesting-master\",\n  urls = [\n    \"https://github.com/bazelbuild/rules_webtesting/archive/master.tar.gz\",\n  ],\n)\nload(\"@io_bazel_rules_webtesting//web:repositories.bzl\", \"browser_repositories\", \"web_test_repositories\")\nweb_test_repositories()\n\ngit_repository(\n  name = \"build_bazel_rules_nodejs\",\n  remote = \"https://github.com/bazelbuild/rules_nodejs.git\",\n  commit = \"d334fd8e2274fb939cf447106dced97472534e80\",\n)\nload(\"@build_bazel_rules_nodejs//:defs.bzl\", \"node_repositories\")\nnode_repositories(package_json = [\"//:package.json\"])\n\ngit_repository(\n    name = \"ts_protoc_gen\",\n    remote = \"https://github.com/improbable-eng/ts-protoc-gen.git\",\n    commit = \"05c52b843edf9420be3a9549d01352dfeff76a5e\",\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\ntypescript_proto_dependencies()\n\ngit_repository(\n  name = \"build_bazel_rules_typescript\",\n  remote = \"https://github.com/bazelbuild/rules_typescript.git\",\n  commit = \"3488d4fb89c6a02d79875d217d1029182fbcd797\",\n)\nload(\"@build_bazel_rules_typescript//:defs.bzl\", \"ts_setup_workspace\")\nts_setup_workspace()\n```   \n\nNow in your `BUILD.bazel`:   \n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nfilegroup(\n  name = \"proto_files\",\n  srcs = glob([\"*.proto\"]),\n)\n\nproto_library(\n  name = \"proto\",\n  srcs = [\n    \":proto_files\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"generate\",\n  proto = \":proto\",\n)\n```    \n\n## Contributing\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\nAs mentioned above, this plugin for `protoc` serves two purposes:\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport { UserServiceClient, GetUserRequest } from \"../generated/users_pb_service\"\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => { /* ... */ });\n```\n\n## Examples\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples).\n\nTo generate the examples from protos, please run `./generate.sh`\n\n## Gotchas\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.7.7-pre.24fbad6","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-00lVte3Pg1n1wf53OA86odYbuewpBwfDIm9vBojT+Spq930WNQuM3CJJ4wt1861K4Q9LiqrOFgcrxeRIYyEWIQ==","shasum":"a7b9cda92d363748bb8a2396ea4f9ccc4a056f05","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.7.7-pre.24fbad6.tgz","fileCount":75,"unpackedSize":89651723,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbijlPCRA9TVsSAnZWagAAwmUQAIzDltsJ5djDFuRHAPOw\nnpwg77szEpPsTQtf1uZMwidct1wtx/+Cz4rKbbZKGK7aqAiHkV4g+WViaavN\ncHlP7/8F1mKTbVf3KVEFt7TFFz3YGaPeS6RT4XlRq46pO+SfcWSJNSMLJDpk\nDyXMw8A87Mzr1IMv8kBsLdfCjO2xsln/gnggXIYsmqW8mat13+mOXBUtwVV0\nN+rtdmM0YrAYpgb0SCrsdMloTQTFCQcJk5Yj5RXUrDi2Rx2oWX/x9p0yQ0tX\n7wvAqLXzvewKmkbKLerf1HeFb3ZSVCBN4w4S9yLgrrKwnN/ofcsHpfSUL87C\nMHbA8Y0p/fu5ljYeSumzBgdCCCmLQPGxmYtKe84BsAJ3aYSHWucWv5rrMFUn\nvXeyOp8qbyRnggYvrK6bab6XwKywTbTb4Af88RmwAMzYXBHKHTVvyM+lYw+H\nHIjYtPeN3pcvl8t5RUAWbUtKBoYfsQEH72ofSFt2BxvyrbDRYfUvcrFh0i8w\nZm3A6WehHoxnRIbYsRzklxw80BFo6JLBPGifEXx1HpwikLPPhuXJQjW+KXxs\nPuqRKJq3Qpo/n+uqg3x5Ja1e2yt5tumhAd2YQ/Etdfj3RhfQ+M5vAGt6pcPC\nPvs8jQb0E5qLYmY5nOHIZEPkEBicseuNRr+Cg/EP02Oslbb7uRw+wet9ijqd\nmXvq\r\n=+6EM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCbOeBTHcWGao6o3aYSA5wtpfpwk7DYNBA3pWdbW8BuCQIhAIwlAAlvaZnSnugulAqlW/H3aBwAXtEvTCG8wTlOQpTB"}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.7.7-pre.24fbad6_1535785292790_0.6537609486419265"},"_hasShrinkwrap":false},"0.7.7-pre.5959599":{"name":"ts-protoc-gen","version":"0.7.7-pre.5959599","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","chai":"^3.5.0","grpc-web-client":"^0.6.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"e71b071fa578a93e2cada1a194d33507658fa4f3","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations \n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\nInclude the following in your `WORKSPACE`:   \n```python\ngit_repository(\n    name = \"io_bazel_rules_go\",\n    commit = \"6bee898391a42971289a7989c0f459ab5a4a84dd\",  # master as of May 10th, 2018\n    remote = \"https://github.com/bazelbuild/rules_go.git\",\n    )\nload(\"@io_bazel_rules_go//go:def.bzl\", \"go_rules_dependencies\", \"go_register_toolchains\")\ngo_rules_dependencies()\ngo_register_toolchains()\n\nhttp_archive(\n  name = \"io_bazel_rules_webtesting\",\n  strip_prefix = \"rules_webtesting-master\",\n  urls = [\n    \"https://github.com/bazelbuild/rules_webtesting/archive/master.tar.gz\",\n  ],\n)\nload(\"@io_bazel_rules_webtesting//web:repositories.bzl\", \"browser_repositories\", \"web_test_repositories\")\nweb_test_repositories()\n\ngit_repository(\n  name = \"build_bazel_rules_nodejs\",\n  remote = \"https://github.com/bazelbuild/rules_nodejs.git\",\n  commit = \"d334fd8e2274fb939cf447106dced97472534e80\",\n)\nload(\"@build_bazel_rules_nodejs//:defs.bzl\", \"node_repositories\")\nnode_repositories(package_json = [\"//:package.json\"])\n\ngit_repository(\n    name = \"ts_protoc_gen\",\n    remote = \"https://github.com/improbable-eng/ts-protoc-gen.git\",\n    commit = \"05c52b843edf9420be3a9549d01352dfeff76a5e\",\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\ntypescript_proto_dependencies()\n\ngit_repository(\n  name = \"build_bazel_rules_typescript\",\n  remote = \"https://github.com/bazelbuild/rules_typescript.git\",\n  commit = \"3488d4fb89c6a02d79875d217d1029182fbcd797\",\n)\nload(\"@build_bazel_rules_typescript//:defs.bzl\", \"ts_setup_workspace\")\nts_setup_workspace()\n```   \n\nNow in your `BUILD.bazel`:   \n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nfilegroup(\n  name = \"proto_files\",\n  srcs = glob([\"*.proto\"]),\n)\n\nproto_library(\n  name = \"proto\",\n  srcs = [\n    \":proto_files\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"generate\",\n  proto = \":proto\",\n)\n```    \n\n## Contributing\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\nAs mentioned above, this plugin for `protoc` serves two purposes:\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport { UserServiceClient, GetUserRequest } from \"../generated/users_pb_service\"\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => { /* ... */ });\n```\n\n## Examples\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples).\n\nTo generate the examples from protos, please run `./generate.sh`\n\n## Gotchas\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.7.7-pre.5959599","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-mzwM+ZH3a1U7ScoDRzQ7eiw/DDrjCZOBh2g+/3sUvI1vbrdda7ykGAYpGb82xI5wO6ErXDcXiqKQw0AbbtSrmA==","shasum":"7df000a69ee5b8f575f9c8644b0cc1e0bfc6f865","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.7.7-pre.5959599.tgz","fileCount":75,"unpackedSize":89660341,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbkRruCRA9TVsSAnZWagAAxK4QAI7PYBqheTJak3IYJ+9e\nvuMWCiJ95mVQCWW5D5XGxVczn5ZYqh0X7FfpFLpqdCivpfwOX2fQHuGOnU9h\n/kwUnASIMfqDh8j/P4simKBYCw6i2zNLlRNxzGc6motckyXy6S861GYJ8jRm\nJMdBgf1fm818VpUy6MMsjHXmlyeuumZa46gKtE6KBHaFK6Jjnbr9taS9/9xz\nr4g+BQYLm5wHnG53FHuHlUIO0Glf8fF3TpeaPR7lrpFHvqe1yPXbKRr+pEwi\nj711Si79wCpHUtF+xuzCWVzzq7Rhuh7uf+72KZtPuS/MEuIpxk5Em+9ew3ZP\neVG0KXc9P97Jq7YYRPhyn8LllhMznwQSRbcgMpoLd44kKCVETYUiai+3H3xX\nxeo1FYgPFwqrzS28DvPCPp7IQUbLMQYTaWLn29I3Lc6c0DfbO1rxPkgP3F4t\nXuh3Nc682W9tliFf7faeWFPr+aXO3C6pQMDgSTlNCOcxh2TglHOqdQ5pgpg2\nlCK1m/dWPNkRyFhSGl3P6oXAHZM5qCSKyjrrg9nI30znfzyNzY6ol46Squec\n6ApfZ2cJI1wE/7IQiq9sKvTWb84ZwcklfGZ4xWe8QLJgE4Lf7FO9rTEHFsYX\nzQDLz8vzSG3RjKy/drFir7rQ9sBTUwM+7LmV1G3ewKhFS54Hd0nUwRnVFCZR\nbF7l\r\n=3fm3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEPnsd0z6uOy7SsOy+fjrZU5QS7sMDPbZgJlQdOMSpD0AiEArpf26i0WwvFL9qk8fXjc0iuVpJr3JYmLWRjIjZbTzjE="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.7.7-pre.5959599_1536236267007_0.1811960677502511"},"_hasShrinkwrap":false},"0.7.7-pre.1d7e310":{"name":"ts-protoc-gen","version":"0.7.7-pre.1d7e310","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","chai":"^3.5.0","grpc-web-client":"^0.6.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"35ed935a07a585a5fcabbddbb5ee50ee1cf9bc31","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations \n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build/>bazel\">bazel</a> build environment</summary><p>\n\nInclude the following in your `WORKSPACE`:   \n\n```python\ngit_repository(\n    name = \"io_bazel_rules_go\",\n    commit = \"6bee898391a42971289a7989c0f459ab5a4a84dd\",  # master as of May 10th, 2018\n    remote = \"https://github.com/bazelbuild/rules_go.git\",\n    )\nload(\"@io_bazel_rules_go//go:def.bzl\", \"go_rules_dependencies\", \"go_register_toolchains\")\ngo_rules_dependencies()\ngo_register_toolchains()\n\nhttp_archive(\n  name = \"io_bazel_rules_webtesting\",\n  strip_prefix = \"rules_webtesting-master\",\n  urls = [\n    \"https://github.com/bazelbuild/rules_webtesting/archive/master.tar.gz\",\n  ],\n)\nload(\"@io_bazel_rules_webtesting//web:repositories.bzl\", \"browser_repositories\", \"web_test_repositories\")\nweb_test_repositories()\n\ngit_repository(\n  name = \"build_bazel_rules_nodejs\",\n  remote = \"https://github.com/bazelbuild/rules_nodejs.git\",\n  commit = \"d334fd8e2274fb939cf447106dced97472534e80\",\n)\nload(\"@build_bazel_rules_nodejs//:defs.bzl\", \"node_repositories\")\nnode_repositories(package_json = [\"//:package.json\"])\n\ngit_repository(\n    name = \"ts_protoc_gen\",\n    remote = \"https://github.com/improbable-eng/ts-protoc-gen.git\",\n    commit = \"05c52b843edf9420be3a9549d01352dfeff76a5e\",\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\ntypescript_proto_dependencies()\n\ngit_repository(\n  name = \"build_bazel_rules_typescript\",\n  remote = \"https://github.com/bazelbuild/rules_typescript.git\",\n  commit = \"3488d4fb89c6a02d79875d217d1029182fbcd797\",\n)\nload(\"@build_bazel_rules_typescript//:defs.bzl\", \"ts_setup_workspace\")\nts_setup_workspace()\n```   \n\nNow in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nfilegroup(\n  name = \"proto_files\",\n  srcs = glob([\"*.proto\"]),\n)\n\nproto_library(\n  name = \"proto\",\n  srcs = [\n    \":proto_files\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"generate\",\n  proto = \":proto\",\n)\n```\n\n</p></details>\n\n## Contributing\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\nAs mentioned above, this plugin for `protoc` serves two purposes:\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport { UserServiceClient, GetUserRequest } from \"../generated/users_pb_service\"\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => { /* ... */ });\n```\n\n## Examples\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples).\n\nTo generate the examples from protos, please run `./generate.sh`\n\n## Gotchas\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.7.7-pre.1d7e310","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-RJb6H6uPKUhT7MJT/1+M/2in3WGc6KjezHXxWZyoQecpRVaHPjVxRpdRZ300B0/thUySNy+Yg1oe0JRQR73OBA==","shasum":"fa6557b46cdf17181a30873e7c333a0fe97d8293","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.7.7-pre.1d7e310.tgz","fileCount":75,"unpackedSize":89660496,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbk55DCRA9TVsSAnZWagAAcPEP/0Msh2ZcgSPZkBWGQ/H0\nfaavKmsY7O0b+FBleRQdS8Cd0cBy4O1iNuGR/GgVZF7xF9K/jWTfNnK8Ze4c\nDaOUoHtusGjFypdiUybRRTQ9QhHlW/3sNKlodPUhhCTWy/rBFTc/IIsdwlW5\nVrPCvDbCMjKgfsFkFEvQAS3JTOGnlgdBubz3gOOn1Hn2b+WDLS+y5d8s8tAs\njWgsIfbY0boAg1+gqpTsPh/U0WdOgttx/VdD3OPKCydLDOxI54/6Bn6UxCrA\nOEF8ZNbRIq9Op9HPlWKSlWsN5Ikcd0D/uPl7J8u5dDiiR5BBhllL/6T+je2V\nyMx95t+78+nU2Qz6H6RafSIWKJ5ZGxh+LE/7aJwZJP+oP40cqrqLkfrJTtGj\nEZsq/6oqSC0vuSPb0AmHvVjj1BXFdvPJkIB0xipDNkkhxw+GtB6pZpT+YjcF\nSGb8HKrgYPvnKBhIzDAEeIHUXntXxFCThRNkC0nfa2jyt9GT+0a/YILrTQ2r\nxSDvUvielyG6SfZAbvsij6Vo6K8RdKrxLHUHyL6w2kMNW0gAJ5NWwm6fJaqE\nhjjARRWgGrPfUgBTB4UPNe199AFOKOeYvIrkbz/naF0F5FaQfjZQ6p2xvKhH\nku8j9HH5ltfZ9vglO42IUALv/YqGXhWGwDfYD2ncJjbheKDSsy+WfXn59vbD\n78Uc\r\n=TI8D\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCpm688szzwbjteugb06H5wKRcfHtGtA8Nz0hmWYG23kgIhAO+l8TzfMXBryo+EhUEV5tKUzOPykIp7ORpWj9Od/Am+"}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.7.7-pre.1d7e310_1536400960361_0.43336754605480676"},"_hasShrinkwrap":false},"0.7.7-pre.5b06c73":{"name":"ts-protoc-gen","version":"0.7.7-pre.5b06c73","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","chai":"^3.5.0","grpc-web-client":"^0.6.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"b04aae850b801cdb5d62ee7c7949e37ddf6f17e7","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations \n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build/>bazel\">bazel</a> build environment</summary><p>\n\nInclude the following in your `WORKSPACE`:   \n\n```python\ngit_repository(\n    name = \"io_bazel_rules_go\",\n    commit = \"6bee898391a42971289a7989c0f459ab5a4a84dd\",  # master as of May 10th, 2018\n    remote = \"https://github.com/bazelbuild/rules_go.git\",\n    )\nload(\"@io_bazel_rules_go//go:def.bzl\", \"go_rules_dependencies\", \"go_register_toolchains\")\ngo_rules_dependencies()\ngo_register_toolchains()\n\nhttp_archive(\n  name = \"io_bazel_rules_webtesting\",\n  strip_prefix = \"rules_webtesting-master\",\n  urls = [\n    \"https://github.com/bazelbuild/rules_webtesting/archive/master.tar.gz\",\n  ],\n)\nload(\"@io_bazel_rules_webtesting//web:repositories.bzl\", \"browser_repositories\", \"web_test_repositories\")\nweb_test_repositories()\n\ngit_repository(\n  name = \"build_bazel_rules_nodejs\",\n  remote = \"https://github.com/bazelbuild/rules_nodejs.git\",\n  commit = \"d334fd8e2274fb939cf447106dced97472534e80\",\n)\nload(\"@build_bazel_rules_nodejs//:defs.bzl\", \"node_repositories\")\nnode_repositories(package_json = [\"//:package.json\"])\n\ngit_repository(\n    name = \"ts_protoc_gen\",\n    remote = \"https://github.com/improbable-eng/ts-protoc-gen.git\",\n    commit = \"05c52b843edf9420be3a9549d01352dfeff76a5e\",\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\ntypescript_proto_dependencies()\n\ngit_repository(\n  name = \"build_bazel_rules_typescript\",\n  remote = \"https://github.com/bazelbuild/rules_typescript.git\",\n  commit = \"3488d4fb89c6a02d79875d217d1029182fbcd797\",\n)\nload(\"@build_bazel_rules_typescript//:defs.bzl\", \"ts_setup_workspace\")\nts_setup_workspace()\n```   \n\nNow in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nfilegroup(\n  name = \"proto_files\",\n  srcs = glob([\"*.proto\"]),\n)\n\nproto_library(\n  name = \"proto\",\n  srcs = [\n    \":proto_files\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"generate\",\n  proto = \":proto\",\n)\n```\n\n</p></details>\n\n## Contributing\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\nAs mentioned above, this plugin for `protoc` serves two purposes:\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport { UserServiceClient, GetUserRequest } from \"../generated/users_pb_service\"\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => { /* ... */ });\n```\n\n## Examples\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples).\n\nTo generate the examples from protos, please run `./generate.sh`\n\n## Gotchas\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.7.7-pre.5b06c73","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-/PXpxH6BYCl0/rFqvqfJS3w+SqoBRoLiHuMyng1sfdoqYRZo0L3DUfz8iSGtZ3CPdcHngMzfTadwTaNCpQXgGw==","shasum":"cfed78ed5345b05fcf1523ff33b09371f3972719","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.7.7-pre.5b06c73.tgz","fileCount":75,"unpackedSize":89660553,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbk55YCRA9TVsSAnZWagAAxNIP/3QKY6fpGlxr2lBGi60g\ntXgtOwJ6+VZnHMcJxattOSyWrAcuBPgU7MLuRxerr+z8OEGTFdMSZAq5iPLv\n5IkTOs6HuehvaH2m+iDAnB9wNr4g160BJ4bxDdbWaBATz6S8mH++NYsxzFA3\nc9i0hJvoKATHPm/iZkzxKVKQCx8v9aHPDJFzbmw1PfxJCFmPZDv7Ph/u4Tro\ngRiOLd2I06S8srkm/4edZ9Dvil0G1zP3yrGut6YMjWLQLdjKpm8BhWpKY4az\nHWKapwMliwRFeQNo6gFaAPQcgmHPJM6R6iq3i56hi77xDoTeYAw44RMIdfgu\nDUchjQapLfeM6G48Eo595V/1GRHOpByEQlEP6cDmOHB6kC03IaQHlGD7MF1T\n59Bqip8NQWY6DLMXnjdPc6HySWSUgNip5FWbQAYHIbX7LWqmUXnqepSfpRRi\nRhuLnwywnIKcgTdv9lZK7LgEfpqzGA9kmh2z3pjESdhe1ufnRw00UofYTm/q\nDbKAAOYk6qD1HaEZ2Q0YsfCV+0bQ+u5S/9YNesMQ/dL94K8qImlTYWVEJAN2\nwhD6unuT13VN+zhAxFze057JuZVJDw2i4joDzzJEEl9TRohaZ7LJPhSisWlA\nwrSyRbtqSZ07pSUTegg+w5buPWNJviAiPF5OnvDfyM5QNLGk+D/JliUlKYci\nKIbZ\r\n=QuHd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHjoX/guLVYbsHsQs1iay9LCBccudKphaeSCS9E6uyi5AiB1cHryZIk/FzffoyHwmS+ihsQTAJM32+Cu3NILTsjrIA=="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.7.7-pre.5b06c73_1536400981785_0.5894021349181913"},"_hasShrinkwrap":false},"0.7.7-pre.687bcc7":{"name":"ts-protoc-gen","version":"0.7.7-pre.687bcc7","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","chai":"^3.5.0","grpc-web-client":"^0.6.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"822e245ef3cedd39ef4d76a2cfe87e48de22e788","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations \n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build/>bazel\">bazel</a> build environment</summary><p>\n\nInclude the following in your `WORKSPACE`:   \n\n```python\ngit_repository(\n    name = \"io_bazel_rules_go\",\n    commit = \"6bee898391a42971289a7989c0f459ab5a4a84dd\",  # master as of May 10th, 2018\n    remote = \"https://github.com/bazelbuild/rules_go.git\",\n    )\nload(\"@io_bazel_rules_go//go:def.bzl\", \"go_rules_dependencies\", \"go_register_toolchains\")\ngo_rules_dependencies()\ngo_register_toolchains()\n\nhttp_archive(\n  name = \"io_bazel_rules_webtesting\",\n  strip_prefix = \"rules_webtesting-master\",\n  urls = [\n    \"https://github.com/bazelbuild/rules_webtesting/archive/master.tar.gz\",\n  ],\n)\nload(\"@io_bazel_rules_webtesting//web:repositories.bzl\", \"browser_repositories\", \"web_test_repositories\")\nweb_test_repositories()\n\ngit_repository(\n  name = \"build_bazel_rules_nodejs\",\n  remote = \"https://github.com/bazelbuild/rules_nodejs.git\",\n  commit = \"d334fd8e2274fb939cf447106dced97472534e80\",\n)\nload(\"@build_bazel_rules_nodejs//:defs.bzl\", \"node_repositories\")\nnode_repositories(package_json = [\"//:package.json\"])\n\ngit_repository(\n    name = \"ts_protoc_gen\",\n    remote = \"https://github.com/improbable-eng/ts-protoc-gen.git\",\n    commit = \"05c52b843edf9420be3a9549d01352dfeff76a5e\",\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\ntypescript_proto_dependencies()\n\ngit_repository(\n  name = \"build_bazel_rules_typescript\",\n  remote = \"https://github.com/bazelbuild/rules_typescript.git\",\n  commit = \"3488d4fb89c6a02d79875d217d1029182fbcd797\",\n)\nload(\"@build_bazel_rules_typescript//:defs.bzl\", \"ts_setup_workspace\")\nts_setup_workspace()\n```   \n\nNow in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nfilegroup(\n  name = \"proto_files\",\n  srcs = glob([\"*.proto\"]),\n)\n\nproto_library(\n  name = \"proto\",\n  srcs = [\n    \":proto_files\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"generate\",\n  proto = \":proto\",\n)\n```\n\n</p></details>\n\n## Contributing\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\nAs mentioned above, this plugin for `protoc` serves two purposes:\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport { UserServiceClient, GetUserRequest } from \"../generated/users_pb_service\"\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => { /* ... */ });\n```\n\n## Examples\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples).\n\nTo generate the examples from protos, please run `./generate.sh`\n\n## Gotchas\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.7.7-pre.687bcc7","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-kb/1NmrmzXDFBEK9Fql2/yH7pSuF4oBf9xr6RueOvQ9sWOi7UiH0sCMSgP5qe2mSUpXgm0ZlevmZVrrgjdxSNA==","shasum":"2fccdcf0f548ad4f4e04fe998d9a8ab54f991ca1","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.7.7-pre.687bcc7.tgz","fileCount":75,"unpackedSize":89660703,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmUqsCRA9TVsSAnZWagAAXZ8P/0eWt4nljUSeFRbxFctV\nm2F2icGU8HNyJGxkM6PhxxgguG/XPK2nYfd2xptqOCkVASUBWdoo1wPlEDqR\nWq8ZC9hapXUrPLDITfZAOg1U/MOMTTPYsGcnpNSa9xZ9H0btnHnGHsmj7mhR\nu6Sfr6BoVaIPMmdicL6pjSra2ASMlR79msZ/zRhTnCXZTJ/mU8pncLBsVtIM\nNYsZgj69ZojYbgW5LetQbAKxXLKFHS+jL6Z9a6xUdthqSrSTS3EAvesWfF9a\nDFHyaJM99+RFO/kTwTKJIq978sxULV+9IYx+30Qd5DZG2aefj8RFea6LPSV6\nSQi238GdC1GPG7X3bKBnJXeW7rBYWRvHRFHMTXaJUfWqmofScAE1krLga7VI\nIUGNilBJjL5vRJv218+8f7FdmoPT18DLN9bWxfNT0kwOtVZf98//lSGXjN2q\nYP4oD5QKKPKAF+0E3z0eM2JTcplD1lQ5afXjYtnYhISo655WTMLWDHBsmz+o\n+YkBOeXGVwhdv+OoDRa9kcJ3PMOXe7ztS5Bl+ItGpyPWZwXyuVBvEWJLoGAI\n1gHR8Scw8Q7nFXFwsvUd1vikzYF+55YbMYONsmZUoZDlMktnxBBMgZHs+INT\n5hEEwmt0ibBXzKsDz7qEY2ubrih+xK8KPBJ/Yc27jxAhsV7UkKsGRambzMc2\nCuVL\r\n=KNLl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICa4zlTqBnnttmtb17wixFfc5bebtpxu2qMVjFRA8UDdAiAWIj24XJ+1MobqlQJwHC0UD45jwKd6MGe1C88sUF7rbg=="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.7.7-pre.687bcc7_1536772777316_0.2905540740433381"},"_hasShrinkwrap":false},"0.7.7-pre.67e0c93":{"name":"ts-protoc-gen","version":"0.7.7-pre.67e0c93","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","chai":"^3.5.0","grpc-web-client":"^0.6.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"f7677e2938e777e31a85a462eab1a43791e76916","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations \n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build/>bazel\">bazel</a> build environment</summary><p>\n\nInclude the following in your `WORKSPACE`:   \n\n```python\ngit_repository(\n    name = \"io_bazel_rules_go\",\n    commit = \"6bee898391a42971289a7989c0f459ab5a4a84dd\",  # master as of May 10th, 2018\n    remote = \"https://github.com/bazelbuild/rules_go.git\",\n    )\nload(\"@io_bazel_rules_go//go:def.bzl\", \"go_rules_dependencies\", \"go_register_toolchains\")\ngo_rules_dependencies()\ngo_register_toolchains()\n\nhttp_archive(\n  name = \"io_bazel_rules_webtesting\",\n  strip_prefix = \"rules_webtesting-master\",\n  urls = [\n    \"https://github.com/bazelbuild/rules_webtesting/archive/master.tar.gz\",\n  ],\n)\nload(\"@io_bazel_rules_webtesting//web:repositories.bzl\", \"browser_repositories\", \"web_test_repositories\")\nweb_test_repositories()\n\ngit_repository(\n  name = \"build_bazel_rules_nodejs\",\n  remote = \"https://github.com/bazelbuild/rules_nodejs.git\",\n  commit = \"d334fd8e2274fb939cf447106dced97472534e80\",\n)\nload(\"@build_bazel_rules_nodejs//:defs.bzl\", \"node_repositories\")\nnode_repositories(package_json = [\"//:package.json\"])\n\ngit_repository(\n    name = \"ts_protoc_gen\",\n    remote = \"https://github.com/improbable-eng/ts-protoc-gen.git\",\n    commit = \"05c52b843edf9420be3a9549d01352dfeff76a5e\",\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\ntypescript_proto_dependencies()\n\ngit_repository(\n  name = \"build_bazel_rules_typescript\",\n  remote = \"https://github.com/bazelbuild/rules_typescript.git\",\n  commit = \"3488d4fb89c6a02d79875d217d1029182fbcd797\",\n)\nload(\"@build_bazel_rules_typescript//:defs.bzl\", \"ts_setup_workspace\")\nts_setup_workspace()\n```   \n\nNow in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nfilegroup(\n  name = \"proto_files\",\n  srcs = glob([\"*.proto\"]),\n)\n\nproto_library(\n  name = \"proto\",\n  srcs = [\n    \":proto_files\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"generate\",\n  proto = \":proto\",\n)\n```\n\n</p></details>\n\n## Contributing\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\nAs mentioned above, this plugin for `protoc` serves two purposes:\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs. \n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport { UserServiceClient, GetUserRequest } from \"../generated/users_pb_service\"\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => { /* ... */ });\n```\n\n## Examples\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples).\n\nTo generate the examples from protos, please run `./generate.sh`\n\n## Gotchas\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.7.7-pre.67e0c93","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-GHMQArtJSrFPZWLlSOmb3VBQGEmDSyuLYSLXenyBTQ08GrdNvSVi0lSf7/KBfnuhGmYm2wdgpneteLwMWjTW2w==","shasum":"85dca3b62c7ee680712ff993f03834bbecf987ea","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.7.7-pre.67e0c93.tgz","fileCount":75,"unpackedSize":89660913,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbmiI0CRA9TVsSAnZWagAAFzwP/iWT+O8KcB5YrmWIiMXR\nqfg/mtPT+xXLuScdJkiv4NIpITT26jyL5RgrwgjhR8cpbDKOU0c7Qa8ubkv/\nW9+gir6hgHFWeXuGg8BAFFhECXRmCQghqtLcDC2tP8IZMKDKdVlg8jYpA3xf\nH00Qp8Ye5TSxIWfrPIXC63FQvx7CRAQ490HHujB9OFgnkRlBmLImOvKqxrRy\nuj3xVgl7Az9p7jYl/jY0VF5BKITHiP4TPQeX8VSR2LFfCrjBh/R/aCSLXan0\nosA8QtvItkYT3DA7/ImSa+G8sH6rK4Zaqy6i9c4Nc9Bvt2g6Hq0sJYAlLUBH\ndgRvsAuLU/2us+pZlyBkeo0WPbrulf5WYEhn9ZXuEWh/CWGuRzOsNvFmM/rS\n23zM9QbJWArQVdtZH+vANOfcLxkzPk6Kuv0M0eoylY1LmG7URFo5ksK0GJPf\nAxfS+bme+viA5eXHO8MoB+hWG7QQORQ4PhZ9EuJFXVr0JvfT46o/648OdNib\nhNlClf99lkQ5cy9dhiI7jFd5Idqai/rnLlZ/Ixhr6JU80u5L5g1UvktfC59a\n5jtpQ3bHZ73A4jIB+SjlybI9ux6bmqaizzsXueAV5rvJNey3ZD1j8TsEsh9C\nGMdty46n6OM5Kw8Fxwjg/RaEz5a30YgSA9edpqJrQ6n+l9d4F0iT1F1yKuAj\nTq/W\r\n=r69d\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDrjuKd2Rp8CCK4wFMpYIrl2vB05S5iUonaTD9ZQ1x6mgIhAJfcGcX7ATxgdjfcqbF5mwyJFm7jqvuOVLcC5FKA54dm"}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.7.7-pre.67e0c93_1536827954523_0.8093474828960601"},"_hasShrinkwrap":false},"0.7.7-pre.8ca48fe":{"name":"ts-protoc-gen","version":"0.7.7-pre.8ca48fe","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","chai":"^3.5.0","grpc-web-client":"^0.6.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"4f87226f31e11ace60fb8fe574ade4c40892fe46","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations \n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build/>bazel\">bazel</a> build environment</summary><p>\n\nInclude the following in your `WORKSPACE`:   \n\n```python\ngit_repository(\n    name = \"io_bazel_rules_go\",\n    commit = \"6bee898391a42971289a7989c0f459ab5a4a84dd\",  # master as of May 10th, 2018\n    remote = \"https://github.com/bazelbuild/rules_go.git\",\n    )\nload(\"@io_bazel_rules_go//go:def.bzl\", \"go_rules_dependencies\", \"go_register_toolchains\")\ngo_rules_dependencies()\ngo_register_toolchains()\n\nhttp_archive(\n  name = \"io_bazel_rules_webtesting\",\n  strip_prefix = \"rules_webtesting-master\",\n  urls = [\n    \"https://github.com/bazelbuild/rules_webtesting/archive/master.tar.gz\",\n  ],\n)\nload(\"@io_bazel_rules_webtesting//web:repositories.bzl\", \"browser_repositories\", \"web_test_repositories\")\nweb_test_repositories()\n\ngit_repository(\n  name = \"build_bazel_rules_nodejs\",\n  remote = \"https://github.com/bazelbuild/rules_nodejs.git\",\n  commit = \"d334fd8e2274fb939cf447106dced97472534e80\",\n)\nload(\"@build_bazel_rules_nodejs//:defs.bzl\", \"node_repositories\")\nnode_repositories(package_json = [\"//:package.json\"])\n\ngit_repository(\n    name = \"ts_protoc_gen\",\n    remote = \"https://github.com/improbable-eng/ts-protoc-gen.git\",\n    commit = \"05c52b843edf9420be3a9549d01352dfeff76a5e\",\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\ntypescript_proto_dependencies()\n\ngit_repository(\n  name = \"build_bazel_rules_typescript\",\n  remote = \"https://github.com/bazelbuild/rules_typescript.git\",\n  commit = \"3488d4fb89c6a02d79875d217d1029182fbcd797\",\n)\nload(\"@build_bazel_rules_typescript//:defs.bzl\", \"ts_setup_workspace\")\nts_setup_workspace()\n```   \n\nNow in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nfilegroup(\n  name = \"proto_files\",\n  srcs = glob([\"*.proto\"]),\n)\n\nproto_library(\n  name = \"proto\",\n  srcs = [\n    \":proto_files\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"generate\",\n  proto = \":proto\",\n)\n```\n\n</p></details>\n\n## Contributing\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\nAs mentioned above, this plugin for `protoc` serves two purposes:\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs. \n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport { UserServiceClient, GetUserRequest } from \"../generated/users_pb_service\"\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => { /* ... */ });\n```\n\n## Examples\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples).\n\nTo generate the examples from protos, please run `./generate.sh`\n\n## Gotchas\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.7.7-pre.8ca48fe","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-R36f1SFc5WTgF5dhhhNCjfyyaw7ButRGmfcUR5AF/Hf172CNlHgAC+gdv8Tbit1GqdaJ3SWzPbOXrQFIrzql+Q==","shasum":"a9da112e1d3345453acc828bd8e60a5e3c46e059","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.7.7-pre.8ca48fe.tgz","fileCount":75,"unpackedSize":89660923,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbqJpNCRA9TVsSAnZWagAAd3QP/15chorImIVS3Xrt33YQ\nRZ6j8WSUXTIW+2K7bghC2lrAkw5YFxt0agh1WvXEnK9hO+dx8Zd3XYBz8n0M\nmxCHraGO5DAUm6VyaO1N4odP89kq1EfPxYMTsfAfW0qza7Ge9yJmilHnwQPr\nTxCou3Ira8YR3Ro4EiFPtEfwymkEWfDIX+k4KIal3pJBQm5NXHjIA9gQCKfQ\n7dIDZf96FGPdc8GVlqSrEF67WafTBdHKVWZIb26v4+vpEUGI1h67cwr5usoe\nKCS5JWXoplP3WiluDaG4FoiTt0rvOfWrtnaLD1eYTkFPyQP/pMCWhS2s9SoB\nCG2yFq4wzmLqapBjxNZyTHk3QfVbuJwYW699mc4lwFnJEC3pQcsqFTbaFSCa\nuOWyNyoaMzPX6umSsemUS9rEaG5C9A87ONWdewtoWqXRKZE+Mytn0gl0HjdS\ngYIBwjIpZcOinDRmwPbe1vKpH/zIkvWJW6Vq0AoFwsOSzQlxzXLfWvPZGeQH\n2LAIZvGILPbJL361AeV7OItvsphwspgaAgn+cLmcvO8+SHHP73CYr+/kwsXX\nPcg7IeiGY7kQUeOoo9Qbim2awASbtPlgbJKSLU8/YECapA+8ufurCGHtURY4\n2zKuTKiN1Hgs9qt1osn/Tw2lL3Xi2Y8UMozF3zO6SbhaC82Zc+FJlM9XT1Dg\nfTh7\r\n=5sw6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBsxkWPhhBfTV3t74wiI40j10tGuFhwzUXy7jnQbVQy1AiEAjz/Y5V02o+PvfF32U5pk5dX+1suBeKEh3Ihc78YpCjg="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.7.7-pre.8ca48fe_1537776202414_0.5739701543334255"},"_hasShrinkwrap":false},"0.7.7-pre.34d3d68":{"name":"ts-protoc-gen","version":"0.7.7-pre.34d3d68","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","chai":"^3.5.0","grpc-web-client":"^0.6.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"feca6c39a66d3e51cf4bff5d2e451884eef48cdd","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations \n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build/>bazel\">bazel</a> build environment</summary><p>\n\nInclude the following in your `WORKSPACE`:   \n\n```python\ngit_repository(\n    name = \"io_bazel_rules_go\",\n    commit = \"6bee898391a42971289a7989c0f459ab5a4a84dd\",  # master as of May 10th, 2018\n    remote = \"https://github.com/bazelbuild/rules_go.git\",\n    )\nload(\"@io_bazel_rules_go//go:def.bzl\", \"go_rules_dependencies\", \"go_register_toolchains\")\ngo_rules_dependencies()\ngo_register_toolchains()\n\nhttp_archive(\n  name = \"io_bazel_rules_webtesting\",\n  strip_prefix = \"rules_webtesting-master\",\n  urls = [\n    \"https://github.com/bazelbuild/rules_webtesting/archive/master.tar.gz\",\n  ],\n)\nload(\"@io_bazel_rules_webtesting//web:repositories.bzl\", \"browser_repositories\", \"web_test_repositories\")\nweb_test_repositories()\n\ngit_repository(\n  name = \"build_bazel_rules_nodejs\",\n  remote = \"https://github.com/bazelbuild/rules_nodejs.git\",\n  commit = \"d334fd8e2274fb939cf447106dced97472534e80\",\n)\nload(\"@build_bazel_rules_nodejs//:defs.bzl\", \"node_repositories\")\nnode_repositories(package_json = [\"//:package.json\"])\n\ngit_repository(\n    name = \"ts_protoc_gen\",\n    remote = \"https://github.com/improbable-eng/ts-protoc-gen.git\",\n    commit = \"05c52b843edf9420be3a9549d01352dfeff76a5e\",\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\ntypescript_proto_dependencies()\n\ngit_repository(\n  name = \"build_bazel_rules_typescript\",\n  remote = \"https://github.com/bazelbuild/rules_typescript.git\",\n  commit = \"3488d4fb89c6a02d79875d217d1029182fbcd797\",\n)\nload(\"@build_bazel_rules_typescript//:defs.bzl\", \"ts_setup_workspace\")\nts_setup_workspace()\n```   \n\nNow in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nfilegroup(\n  name = \"proto_files\",\n  srcs = glob([\"*.proto\"]),\n)\n\nproto_library(\n  name = \"proto\",\n  srcs = [\n    \":proto_files\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"generate\",\n  proto = \":proto\",\n)\n```\n\n</p></details>\n\n## Contributing\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\nAs mentioned above, this plugin for `protoc` serves two purposes:\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs. \n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport { UserServiceClient, GetUserRequest } from \"../generated/users_pb_service\"\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => { /* ... */ });\n```\n\n## Examples\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples).\n\nTo generate the examples from protos, please run `./generate.sh`\n\n## Gotchas\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.7.7-pre.34d3d68","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-VhW2XpaSFRVTEgSarw48rgZdz6X27eH8hC3KtQ7NgH0uTyEfHy1q8j0NSvqy59/7CLM3QqhCPeGBmYz00+Gayg==","shasum":"dd145f7184067d26523f52c5681b5a47eb9b33e6","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.7.7-pre.34d3d68.tgz","fileCount":75,"unpackedSize":89661081,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbwa5vCRA9TVsSAnZWagAA7vwP/1NdPrSy93fyHaG6EiiC\nF8t6X6RLZXLYGsj2V2TxNNHW6ykR1vBKOWixMj3tlMn+xP8O5sBuj36sCYbU\nYFyHkYZ2MM8kn7hyCWi0SLfBeHnsc5DwRSrvmjWl/uxPkghqae+fg82a47hj\nCiG9SXwjp7D3Q/jf+VhGHX1I36Zz8eoNbOS6EaTuI2KAP3VgcsIQGg4cz5BM\n2niWUbiSL882rBGOuExDEWuvGLLAlt9X4wLEEOjvoDNTnPjPifyMfV4e+2g5\n/8nVt3x9eBM7wdg6JUS1NMdQHFq+Y+Ybuc4VbhKQWpg4RL83mTfpUfwd/NOu\nFX9YpOIQaE9NzZlRVsFrvElvvdRE5wcoIr+ipYdl+nsZw+caaqotmXTwFYCA\nX0PuSDArFXsSx++inhgutjzp32S74/QRowcFEun34Rtuo5JcUPK2QIHVeIdN\nICEJ/wa6aS2HwJwWWrTqqSO/adbqMfNruhn16oAT/gn/3Lsm4T3mCDKVJ+Vk\nHh3idEqWy+e+pM7CUt0bF07+sKtGhoJovzCGFM2t5FE+U70ZXXJEYhsoXc0/\n5LwXF8+QFBKuLa25RUM3sSNhx4OUYCapIazk4La8sXj8pc6vEhHI2RTGXCw2\n8sYKJzBuwznKvBo36cyKcN6Z7q0ZRh+KZHKI3yvg+84S9cKIOL1sVFonxjI4\nDwmF\r\n=OiOj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQkNzDRJPy5VHt+qFDDFlvhc080Iv2YpKB+2oH0mYWQgIhAM7Z2+9rNbO/AeBiuG2SGyPs3MziiGsg1wWNKL+zbZLc"}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.7.7-pre.34d3d68_1539419757193_0.22068926124720512"},"_hasShrinkwrap":false},"0.7.7-pre":{"name":"ts-protoc-gen","version":"0.7.7-pre","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","chai":"^3.5.0","grpc-web-client":"^0.6.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"0553580cc3911070d20bfd81420b570e7fb8911e","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations \n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build/>bazel\">bazel</a> build environment</summary><p>\n\nInclude the following in your `WORKSPACE`:   \n\n```python\ngit_repository(\n    name = \"io_bazel_rules_go\",\n    commit = \"6bee898391a42971289a7989c0f459ab5a4a84dd\",  # master as of May 10th, 2018\n    remote = \"https://github.com/bazelbuild/rules_go.git\",\n    )\nload(\"@io_bazel_rules_go//go:def.bzl\", \"go_rules_dependencies\", \"go_register_toolchains\")\ngo_rules_dependencies()\ngo_register_toolchains()\n\nhttp_archive(\n  name = \"io_bazel_rules_webtesting\",\n  strip_prefix = \"rules_webtesting-master\",\n  urls = [\n    \"https://github.com/bazelbuild/rules_webtesting/archive/master.tar.gz\",\n  ],\n)\nload(\"@io_bazel_rules_webtesting//web:repositories.bzl\", \"browser_repositories\", \"web_test_repositories\")\nweb_test_repositories()\n\ngit_repository(\n  name = \"build_bazel_rules_nodejs\",\n  remote = \"https://github.com/bazelbuild/rules_nodejs.git\",\n  commit = \"d334fd8e2274fb939cf447106dced97472534e80\",\n)\nload(\"@build_bazel_rules_nodejs//:defs.bzl\", \"node_repositories\")\nnode_repositories(package_json = [\"//:package.json\"])\n\ngit_repository(\n    name = \"ts_protoc_gen\",\n    remote = \"https://github.com/improbable-eng/ts-protoc-gen.git\",\n    commit = \"05c52b843edf9420be3a9549d01352dfeff76a5e\",\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\ntypescript_proto_dependencies()\n\ngit_repository(\n  name = \"build_bazel_rules_typescript\",\n  remote = \"https://github.com/bazelbuild/rules_typescript.git\",\n  commit = \"3488d4fb89c6a02d79875d217d1029182fbcd797\",\n)\nload(\"@build_bazel_rules_typescript//:defs.bzl\", \"ts_setup_workspace\")\nts_setup_workspace()\n```   \n\nNow in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nfilegroup(\n  name = \"proto_files\",\n  srcs = glob([\"*.proto\"]),\n)\n\nproto_library(\n  name = \"proto\",\n  srcs = [\n    \":proto_files\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"generate\",\n  proto = \":proto\",\n)\n```\n\n</p></details>\n\n## Contributing\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\nAs mentioned above, this plugin for `protoc` serves two purposes:\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs. \n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport { UserServiceClient, GetUserRequest } from \"../generated/users_pb_service\"\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => { /* ... */ });\n```\n\n## Examples\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples).\n\nTo generate the examples from protos, please run `./generate.sh`\n\n## Gotchas\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.7.7-pre","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-F3c2+1ZNh19Bhd7yHoioFxj8KtKA22mYo676lOKw5UCA94o7CXYDWbqFtxyveL3rL53EPZyZBfbDt0hZU1TI9w==","shasum":"2d7a432755464c43199850321eea91e8d0de2a8f","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.7.7-pre.tgz","fileCount":74,"unpackedSize":144381,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbwwv8CRA9TVsSAnZWagAAkb8P/R2WpUpM1/OPlTwtlzHH\nAUaqCnM61vA9ApptxJUT0q9TPhVUROnl8BRD4OGEReJLP2FFCCy9SLso/N7i\n018pBDY4YjmCNsVQdmn624nzwp8+kRgxOuq3uOUtXapukcSBhAHzQ9+tL5Wd\nRcFADaYtJ5jw37z0DD2q+kwZJD1gQ+NHzMQ0+I+2vl3I1kC985EsNVTk5Ikt\nNyTSljkUYYAUK8JYwVoxNozVHFCwJ6ioR1rbj36iCIUbeNLY1WBNG7cLWlKC\nyXtPWrMLPU3e7vhj0jugTDmZ0XuBy1TJN+dXlAQDp1njWOdk6EsyhqwV133O\n4cdVAJBEblzy3NiSwAK7kM7tvgwm6Zkug4D+eLGgi0GOyKykp/Wu4gXU0P9b\nuPUYLwGDddmurpD+OUEkT697wAabl3XwwQBFAdkztzQFTiX85JPXAyYQLyM4\nZE+RQQTQz2/jFcZar+SFArsfv6079Cb76IIpESmNSPPFHavjylgnjDW6XuTf\nwoPvEEgM3m8zoiqPwzDePPeltn8+Wpf2e/whjpwuVYGhurR0/zIvsp0tqiTV\nTYZnbImkDyWg/k8PQfRasClZGTgoNT3e+VYY/WV5RXkuIw/x5uQb/rznZ+Zw\nh3g2aXe9cTUidsIfgQ0HMKBVT7msFK4bl8TkjUR9gMEgAFePtFlOzSZ7/xTF\nu0ar\r\n=9fO3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDrRsrNVooRRS8WoL5PGe3PsHmwy/6IOFLas4tAMTIA/wIgOiVFIilyaGeW4hzLMquabFdVMfaJczojFX/9U2PgG8Q="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.7.7-pre_1539509243636_0.4618914736955648"},"_hasShrinkwrap":false},"0.7.7-pre.d9ec484":{"name":"ts-protoc-gen","version":"0.7.7-pre.d9ec484","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","chai":"^3.5.0","grpc-web-client":"^0.6.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"79576f8f3c5836e10479ce3d53be9c59875e21a2","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations \n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build/>bazel\">bazel</a> build environment</summary><p>\n\nInclude the following in your `WORKSPACE`:   \n\n```python\ngit_repository(\n    name = \"io_bazel_rules_go\",\n    commit = \"6bee898391a42971289a7989c0f459ab5a4a84dd\",  # master as of May 10th, 2018\n    remote = \"https://github.com/bazelbuild/rules_go.git\",\n    )\nload(\"@io_bazel_rules_go//go:def.bzl\", \"go_rules_dependencies\", \"go_register_toolchains\")\ngo_rules_dependencies()\ngo_register_toolchains()\n\nhttp_archive(\n  name = \"io_bazel_rules_webtesting\",\n  strip_prefix = \"rules_webtesting-master\",\n  urls = [\n    \"https://github.com/bazelbuild/rules_webtesting/archive/master.tar.gz\",\n  ],\n)\nload(\"@io_bazel_rules_webtesting//web:repositories.bzl\", \"browser_repositories\", \"web_test_repositories\")\nweb_test_repositories()\n\ngit_repository(\n  name = \"build_bazel_rules_nodejs\",\n  remote = \"https://github.com/bazelbuild/rules_nodejs.git\",\n  commit = \"d334fd8e2274fb939cf447106dced97472534e80\",\n)\nload(\"@build_bazel_rules_nodejs//:defs.bzl\", \"node_repositories\")\nnode_repositories(package_json = [\"//:package.json\"])\n\ngit_repository(\n    name = \"ts_protoc_gen\",\n    remote = \"https://github.com/improbable-eng/ts-protoc-gen.git\",\n    commit = \"05c52b843edf9420be3a9549d01352dfeff76a5e\",\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\ntypescript_proto_dependencies()\n\ngit_repository(\n  name = \"build_bazel_rules_typescript\",\n  remote = \"https://github.com/bazelbuild/rules_typescript.git\",\n  commit = \"3488d4fb89c6a02d79875d217d1029182fbcd797\",\n)\nload(\"@build_bazel_rules_typescript//:defs.bzl\", \"ts_setup_workspace\")\nts_setup_workspace()\n```   \n\nNow in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nfilegroup(\n  name = \"proto_files\",\n  srcs = glob([\"*.proto\"]),\n)\n\nproto_library(\n  name = \"proto\",\n  srcs = [\n    \":proto_files\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"generate\",\n  proto = \":proto\",\n)\n```\n\n</p></details>\n\n## Contributing\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\nAs mentioned above, this plugin for `protoc` serves two purposes:\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs. \n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport { UserServiceClient, GetUserRequest } from \"../generated/users_pb_service\"\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => { /* ... */ });\n```\n\n## Examples\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples).\n\nTo generate the examples from protos, please run `./generate.sh`\n\n## Gotchas\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.7.7-pre.d9ec484","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-JCBGUGWxeaG0CXGOtu/WiLZZ3VvJBmUOCdtBRB6Kv5q5xO1Zb9rOCGRWEErH2ndREqpPR8AKJYOnDMA4pWo+Tg==","shasum":"c9e55e7463e4efd9513c5e384193509dd57e12d3","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.7.7-pre.d9ec484.tgz","fileCount":74,"unpackedSize":144389,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbwyhqCRA9TVsSAnZWagAAPOwP/078KFbj8holkMA38p4h\nyXRPgqir64rHSvO6jXyMHo2B0TuH5AuDtgWwxe/4zg6ohD8TtlsK6u+Xt/Wx\nl3foso7duFjh9ZJEAUz3JCXD45iXRJrtNId8LvZuWqnDTF+J5qqrLPrNRN9F\nKV2LVDpOXZiy2eCHMJRZdQIgzhmr4pcTg/FX+LSrZxW0gKEcogLvYO/X1TWq\nMcLQ7igNuNu/o05eMDs6Zc1XjJ8pMpfFT6Qp5tic4L8b+i1lCMcJ+PMCWCBF\n86wjlqFEdvEo6glhXzHRSnjmS/EnZA0UnnW5VQX8c8qrRgtCioOqcFlAcp/s\njZqQ1FatPbErsAGDtTmn90bqwAs8nmPCaRhin6KwBjZ65bkGXcnvSlz/pSCb\nJuw4M3KCYswMuwUKhwmIeDP5m+q5QRIML6WxmuShdxEF2MApWbIz8MZNA0su\njKRl70ORQgpWypmRBuq+plujDWVR0z5OPo4HUHwxpW1DCKSrDoVti/3khxaj\nAtAxxm2Ip/F3ogKKJbEPrvABwjO/tpK9E+vW+yH/GVaNJG+bAjObW6P0qBtf\n0qinyghQeYsxBCk0DW0n0zPkTVo9r/aJ4C0KNdWCu4l91sABDGaTxt+ifEfJ\nuABguv9/2CzciuSmQM71aXmevLUwCqTgqHfYGP8+m6WWOrMTTDBBsf/5k/+z\nZRTO\r\n=+ytT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhGj14baNpaBysRJ7dQX1fkj05hgQbYhngsp5pH1acKQIgRde584uEo+PxPDj8Mw+GRCN3EwBR+QtxEDTiLQwciMQ="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.7.7-pre.d9ec484_1539516521408_0.5186672844224147"},"_hasShrinkwrap":false},"0.7.7":{"name":"ts-protoc-gen","version":"0.7.7","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","chai":"^3.5.0","grpc-web-client":"^0.6.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"ef031bfd5ed9ee08b35367e6c436d2fb80e46084","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.7.7","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-7l/uRXkVYcXdYaLPZJUcrC3ud5LX7XpPbDE7HFGwxWkACL0CrgL91wGgNNwTaIQOaZNGc7Hygw8mClpc1yuDEg==","shasum":"97cff816ed15c6a6301c6a68470a8a816b55b44b","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.7.7.tgz","fileCount":74,"unpackedSize":145447,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbwynmCRA9TVsSAnZWagAAfx8QAIGIea4TJ3lwRXAy+Sse\nVxEZPTXEEMEg3xBWlnMaOQhpVckLIyl9a0l0LYKevzg1/6sT/UDYLxMuz8jO\nhk4p7mEoPJoSyyBS5ujvRZbhUGYGCB7zGoug0z2jIxmdsfcpQnZ75NzUSEyN\nt2dY8Rr+ZWia95IM6Bz7ydUvFB8tjKbWO0B5ebwfT+sKsnp1WCQvkJIyc7rT\nxxYzCSKnI+kWpWIOeHiFWJP5BTMEXyYUc5asXAc7dBJeKk9/AeYEeYaiShbz\nxUlf//mnUl8wzF4Ea52HFjI7P0cD7wdBQwGi/34pUTa9XWMJDlIpO370oIbY\nFBJNZI13EQ70qZT+qr+Qa5NDPMyxDeNA8bjyTQ+En8TeakqPDAgPy4ukZ5+A\nFpSLb7qqBliIOxPCAy8G+cc/NdiTFz88TbGCjIAuMtDDc8V8tsRV/UVgOiV2\nt6S5UbySCXn3HSxSotm7b4uQXTmMromZeKiQ9pw7isywOR9qPXdeaSZDbB70\nHZcdOmXiALwevYdEfrA3uCL1gDCPtF1b6m1qUVxZKMStGhpl+wZolNrWmW9D\nOkkTATECiI/IxiQ/Ix4181fB3dIQ6zc8Zma+dolVV9gKJBqlTqieDpCUWTvL\nna/9e0TObSUR+dUGRwXusPl3vkuDBP/HVAMfxweyW1KkEiMt58un1wm4SgVg\n/MPs\r\n=vkHU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCT5RNmFMptYnjVV3STGmIesjsrakKvwXZ5X5hsrIt76QIhAJOlEunOi57Nzt48asPuB10s+GRq2dkR4r5bBOBKL0Qd"}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.7.7_1539516902208_0.25892108555701565"},"_hasShrinkwrap":false},"0.7.8-pre":{"name":"ts-protoc-gen","version":"0.7.8-pre","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","chai":"^3.5.0","grpc-web-client":"^0.6.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"0b5d779568338981c9fc016a2cd5e9cedadce1f1","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations \n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build/>bazel\">bazel</a> build environment</summary><p>\n\nInclude the following in your `WORKSPACE`:   \n\n```python\ngit_repository(\n    name = \"io_bazel_rules_go\",\n    commit = \"6bee898391a42971289a7989c0f459ab5a4a84dd\",  # master as of May 10th, 2018\n    remote = \"https://github.com/bazelbuild/rules_go.git\",\n    )\nload(\"@io_bazel_rules_go//go:def.bzl\", \"go_rules_dependencies\", \"go_register_toolchains\")\ngo_rules_dependencies()\ngo_register_toolchains()\n\nhttp_archive(\n  name = \"io_bazel_rules_webtesting\",\n  strip_prefix = \"rules_webtesting-master\",\n  urls = [\n    \"https://github.com/bazelbuild/rules_webtesting/archive/master.tar.gz\",\n  ],\n)\nload(\"@io_bazel_rules_webtesting//web:repositories.bzl\", \"browser_repositories\", \"web_test_repositories\")\nweb_test_repositories()\n\ngit_repository(\n  name = \"build_bazel_rules_nodejs\",\n  remote = \"https://github.com/bazelbuild/rules_nodejs.git\",\n  commit = \"d334fd8e2274fb939cf447106dced97472534e80\",\n)\nload(\"@build_bazel_rules_nodejs//:defs.bzl\", \"node_repositories\")\nnode_repositories(package_json = [\"//:package.json\"])\n\ngit_repository(\n    name = \"ts_protoc_gen\",\n    remote = \"https://github.com/improbable-eng/ts-protoc-gen.git\",\n    commit = \"05c52b843edf9420be3a9549d01352dfeff76a5e\",\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\ntypescript_proto_dependencies()\n\ngit_repository(\n  name = \"build_bazel_rules_typescript\",\n  remote = \"https://github.com/bazelbuild/rules_typescript.git\",\n  commit = \"3488d4fb89c6a02d79875d217d1029182fbcd797\",\n)\nload(\"@build_bazel_rules_typescript//:defs.bzl\", \"ts_setup_workspace\")\nts_setup_workspace()\n```   \n\nNow in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nfilegroup(\n  name = \"proto_files\",\n  srcs = glob([\"*.proto\"]),\n)\n\nproto_library(\n  name = \"proto\",\n  srcs = [\n    \":proto_files\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"generate\",\n  proto = \":proto\",\n)\n```\n\n</p></details>\n\n## Contributing\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\nAs mentioned above, this plugin for `protoc` serves two purposes:\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs. \n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport { UserServiceClient, GetUserRequest } from \"../generated/users_pb_service\"\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => { /* ... */ });\n```\n\n## Examples\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples).\n\nTo generate the examples from protos, please run `./generate.sh`\n\n## Gotchas\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.7.8-pre","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-VDUPQeFVZRzbUk372LoovqZQBY4Upccb3tw+f0OdReK6zJ3fcaeheFY8g65YvcFFwi5wX/j67OVy5vmrMXO0/A==","shasum":"f2df9d02962db466efd2e0d986e2fa49c25b6deb","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.7.8-pre.tgz","fileCount":74,"unpackedSize":145465,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbw0qMCRA9TVsSAnZWagAAM5gP+QCIQT1fTX2TfcQCTmqn\n95cCKiCxyWy9q/37+DhmTEJDrCsZBSWI3BUdLzAC9aP7LxKro8HfxQZftHW6\nWiLgI1s9xQ+WwnWm8FsHHUAHha7+Jnq6OwSed+mmq8dJY4uN9ORhjy8WK6GG\ny0vN3W0Q6c8UjYAP5YfKbArcgkNui8UwO5HOuWYVSGlg5AqSwvc3MdwKvNRp\nd0nWBAl7l3hC9ujO8vQFib/1LZXuPBW6zJuxEJYRAsondjMRaGT5kgtKbxxd\ngp1Dn+acUGxbW12g9E+S5XT6VIr8iTPjGtNgP1rKcXZga/jva0ROSzqIJzv1\n3GEqKqYD3Gq+rY7GSnwD24mAChgwY9fQYUJsWS7WCz6qRGX3JTAZgwNFciWQ\n8l3r6mJjQWKHiscV9Lsw+LoFk+dN9UQ4tY6ghTdUg1oExlGJKYiZzMqPgc/M\netqNq/HIv5j4nMZKMH6NS52xD0PYA+Na5RFLw9MxnAXHdNOWMxbFkYWgJAY+\nAUtKtgvRvFDLpygbU3kpCYINwu7FHXVntRn0LSm02qkQGQPVH0xh3q9U/ApP\nK431JMRX8w0Dctzqt5NnJa+2rpurKzJM/4cgPhYeBtf5eeuw8Z96P1hgN8cP\nC6W7DxF/aXn9WG064lvuUU8T4LVFjH8LGIA0hCL/++V6hlguAwqpLxnpksx1\nmj/d\r\n=548h\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC7pQZGSBx60iybRAZ1i/zyJM9wNDyJ51E8S3j1NPvx4AIgHHNSWCUU9D5bRqqtHf3GIN/ZEH4824vVCjPhBk0UPsc="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.7.8-pre_1539525259621_0.37894660981398776"},"_hasShrinkwrap":false},"0.7.8-pre.b7267ea":{"name":"ts-protoc-gen","version":"0.7.8-pre.b7267ea","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","chai":"^3.5.0","grpc-web-client":"^0.6.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"c8bf9a627c205707ffc771310ac74924d128d869","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations \n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build/>bazel\">bazel</a> build environment</summary><p>\n\nInclude the following in your `WORKSPACE`:   \n\n```python\ngit_repository(\n    name = \"io_bazel_rules_go\",\n    commit = \"6bee898391a42971289a7989c0f459ab5a4a84dd\",  # master as of May 10th, 2018\n    remote = \"https://github.com/bazelbuild/rules_go.git\",\n    )\nload(\"@io_bazel_rules_go//go:def.bzl\", \"go_rules_dependencies\", \"go_register_toolchains\")\ngo_rules_dependencies()\ngo_register_toolchains()\n\nhttp_archive(\n  name = \"io_bazel_rules_webtesting\",\n  strip_prefix = \"rules_webtesting-master\",\n  urls = [\n    \"https://github.com/bazelbuild/rules_webtesting/archive/master.tar.gz\",\n  ],\n)\nload(\"@io_bazel_rules_webtesting//web:repositories.bzl\", \"browser_repositories\", \"web_test_repositories\")\nweb_test_repositories()\n\ngit_repository(\n  name = \"build_bazel_rules_nodejs\",\n  remote = \"https://github.com/bazelbuild/rules_nodejs.git\",\n  commit = \"d334fd8e2274fb939cf447106dced97472534e80\",\n)\nload(\"@build_bazel_rules_nodejs//:defs.bzl\", \"node_repositories\")\nnode_repositories(package_json = [\"//:package.json\"])\n\ngit_repository(\n    name = \"ts_protoc_gen\",\n    remote = \"https://github.com/improbable-eng/ts-protoc-gen.git\",\n    commit = \"05c52b843edf9420be3a9549d01352dfeff76a5e\",\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\ntypescript_proto_dependencies()\n\ngit_repository(\n  name = \"build_bazel_rules_typescript\",\n  remote = \"https://github.com/bazelbuild/rules_typescript.git\",\n  commit = \"3488d4fb89c6a02d79875d217d1029182fbcd797\",\n)\nload(\"@build_bazel_rules_typescript//:defs.bzl\", \"ts_setup_workspace\")\nts_setup_workspace()\n```   \n\nNow in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nfilegroup(\n  name = \"proto_files\",\n  srcs = glob([\"*.proto\"]),\n)\n\nproto_library(\n  name = \"proto\",\n  srcs = [\n    \":proto_files\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"generate\",\n  proto = \":proto\",\n)\n```\n\n</p></details>\n\n## Contributing\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\nAs mentioned above, this plugin for `protoc` serves two purposes:\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs. \n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport { UserServiceClient, GetUserRequest } from \"../generated/users_pb_service\"\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => { /* ... */ });\n```\n\n## Examples\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples).\n\nTo generate the examples from protos, please run `./generate.sh`\n\n## Gotchas\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.7.8-pre.b7267ea","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-/YFt6ByFgSbc2PNYQ5VxNlYQXNePfTTxHtxGzY4IkSBscVKM9jTA3mmpthZM1xXEZQKUslQDKghL4q2K5iDi5w==","shasum":"e5442741f8281a9836c1d21d7a4be8c92f0d481f","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.7.8-pre.b7267ea.tgz","fileCount":74,"unpackedSize":145679,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbxfFLCRA9TVsSAnZWagAAJOIQAJTDpblugTRNEiiMNTlA\nVxvkVt26GR4h6CfOl88Xyhib0cTL/uLDccwIhHiNHAKxsV0scUJ9XrHRgESy\nX8lS81s9RjeKdABV28IRSfb9kbfcO61ACH9La7OKKz3W7ZOEsan/EpOi+dxj\nVXQ0X/DOyn1wVvPed+04vhQwr8n3ipd4UMQ7EKexMzmqulyJWgQ/pnSD+0ME\n2JCoanBjVL5xbPNqBh3hjYbvnjD2CkVWa0EHycHz/0xXnTrDGoZfbLG+erct\nR+1gtxA7vE1GIbXOBl+2PUBjx1eyJap+ZR1+6WM4ZwVBu0kMQh3nhNR1XsY1\n7BOMaGquE6PfnSJrehTrUsX+5QwvvYNwboLKf/uJOSYs1y30eBmI9UtNkQMb\nfsTT/MuLQS71RwuOitXkB1eWVqDBLxcaMbyTkUVcNVm8k3KbOs36+fHiJoV3\nXoY/ddwG72sCNwqWEYj8lQB5yJz8YM/R9ZbxNtFrmAmi49556s5QXTu49bJW\ndYfJxP3QSMn6FZdC6Qg9v50HvF4xpjGx8wAj6CNSoc2+ZOjJ5CzBQ+XNQHlz\nmFtzMkQBIA4fDDQpFMID/hevQFUj9S7nmvMhLDKhhKOIKNiZK9kcMH5XGeC8\nRh6ZlQnCSJgxoShIG8DiYCT5wpTBPOPIhUSKmvZ5ixyBSAF1i3KQRM7OSlfp\nTJI0\r\n=E1xr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGTuUsaABDgu3hceaS9lCNYrKm5yWTueBNYDqQKuyKA/AiArZ/VeumZU3rulTUI1DBSFnfnvEIFN5QAGxYfHoPmLBA=="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.7.8-pre.b7267ea_1539699018626_0.5051361782012915"},"_hasShrinkwrap":false},"0.7.8-pre.7846e2f":{"name":"ts-protoc-gen","version":"0.7.8-pre.7846e2f","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","chai":"^3.5.0","grpc-web-client":"^0.6.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"b976cfd592d515426bbf62be59cbeada09b0279f","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations \n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build/>bazel\">bazel</a> build environment</summary><p>\n\nInclude the following in your `WORKSPACE`:   \n\n```python\ngit_repository(\n    name = \"io_bazel_rules_go\",\n    commit = \"6bee898391a42971289a7989c0f459ab5a4a84dd\",  # master as of May 10th, 2018\n    remote = \"https://github.com/bazelbuild/rules_go.git\",\n    )\nload(\"@io_bazel_rules_go//go:def.bzl\", \"go_rules_dependencies\", \"go_register_toolchains\")\ngo_rules_dependencies()\ngo_register_toolchains()\n\nhttp_archive(\n  name = \"io_bazel_rules_webtesting\",\n  strip_prefix = \"rules_webtesting-master\",\n  urls = [\n    \"https://github.com/bazelbuild/rules_webtesting/archive/master.tar.gz\",\n  ],\n)\nload(\"@io_bazel_rules_webtesting//web:repositories.bzl\", \"browser_repositories\", \"web_test_repositories\")\nweb_test_repositories()\n\ngit_repository(\n  name = \"build_bazel_rules_nodejs\",\n  remote = \"https://github.com/bazelbuild/rules_nodejs.git\",\n  commit = \"d334fd8e2274fb939cf447106dced97472534e80\",\n)\nload(\"@build_bazel_rules_nodejs//:defs.bzl\", \"node_repositories\")\nnode_repositories(package_json = [\"//:package.json\"])\n\ngit_repository(\n    name = \"ts_protoc_gen\",\n    remote = \"https://github.com/improbable-eng/ts-protoc-gen.git\",\n    commit = \"05c52b843edf9420be3a9549d01352dfeff76a5e\",\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\ntypescript_proto_dependencies()\n\ngit_repository(\n  name = \"build_bazel_rules_typescript\",\n  remote = \"https://github.com/bazelbuild/rules_typescript.git\",\n  commit = \"3488d4fb89c6a02d79875d217d1029182fbcd797\",\n)\nload(\"@build_bazel_rules_typescript//:defs.bzl\", \"ts_setup_workspace\")\nts_setup_workspace()\n```   \n\nNow in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nfilegroup(\n  name = \"proto_files\",\n  srcs = glob([\"*.proto\"]),\n)\n\nproto_library(\n  name = \"proto\",\n  srcs = [\n    \":proto_files\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"generate\",\n  proto = \":proto\",\n)\n```\n\n</p></details>\n\n## Contributing\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\nAs mentioned above, this plugin for `protoc` serves two purposes:\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs. \n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport { UserServiceClient, GetUserRequest } from \"../generated/users_pb_service\"\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => { /* ... */ });\n```\n\n## Examples\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples).\n\nTo generate the examples from protos, please run `./generate.sh`\n\n## Gotchas\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.7.8-pre.7846e2f","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-vIeOCPXsa58KX8yALyO0New6f2jo+DgiYlmql1faC7nAOmRb1HR9TkIyswiMH1aN+H5Q59mLMHqyliUyTBsZAg==","shasum":"0412f8d93c1e30d86519a8cde8c8dadd6c283c63","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.7.8-pre.7846e2f.tgz","fileCount":74,"unpackedSize":146413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbxkN8CRA9TVsSAnZWagAAzeoP/j2/heXmG0HHxbyZq0MG\nfrPmGcVCDiD/GrLJkntXaOS75pd5SiSMmfPTeiN8F7zDf3hpmy7dgpo21no0\nIOjBeIhUjFBl+ej8qr8UglQ7vGIZQb2cTaR0zpySOTbldS1XWSkWPY4dsluU\noQY2UCUr2vP3op/y27KVwjtbXs6GDurUkvfvtcxDO0CWIGY0PU/cc75stTlK\ntLJpUXBMVS340OrORJ9eJ9jUPlf6RyYAEDFXSZUz7IYayMkqHO5W197hqI8a\n7rY/qlqXxUdgFt5j5ZLzvFGVct9SNcIilTLb7ykhOth3SdYcMT/ht61586GV\nM4OJP1DSI/MTrSXzkuSHyH+cT8d1MnAUWRvchHqCO4H2tr5qyR2vPwbyABkJ\nW0PpiJv0bMA9VsJyoa29+6rxagLLEctbkzr6ABALOKR729+NvDurWbwz6wRK\nqU68XDm4iBHUDBznzqoho9kBKQgQFfpX7jvgoxtC9SxHB8QObThfA3J5uBAf\nnJBLZ1WuM76Icb+KaS4yTl1T/xxlDwkRnQOB/LBtrn6EF1Xrb/3BQUi79d8C\n0iEFPual7ZrfP1HJ+zpgOeNCJdVELvzA9GB6eL8vAbYDop3FY+NeJPJSEGv+\nrLjBpobOoHw3jO9rLfstnJCuAEWr53W2vJV2tAOr3gw12dpgvCFwDYcbdadZ\nK6+G\r\n=YnxT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGkRS0WuNHeqYo5vRsnVixy9uc0CVF95N4LyL4aoFL/1AiAQ9WIaR1NN3NLCHBIVqD13HxGABKpJf2lgCjkQzy/MWQ=="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.7.8-pre.7846e2f_1539720059695_0.7029146030969662"},"_hasShrinkwrap":false},"0.7.8-pre.51f57ea":{"name":"ts-protoc-gen","version":"0.7.8-pre.51f57ea","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","chai":"^3.5.0","grpc-web-client":"^0.6.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"c2e1160ad198f45711162fcabdd2b5e93a617081","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations \n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build/>bazel\">bazel</a> build environment</summary><p>\n\nInclude the following in your `WORKSPACE`:   \n\n```python\ngit_repository(\n    name = \"io_bazel_rules_go\",\n    commit = \"6bee898391a42971289a7989c0f459ab5a4a84dd\",  # master as of May 10th, 2018\n    remote = \"https://github.com/bazelbuild/rules_go.git\",\n    )\nload(\"@io_bazel_rules_go//go:def.bzl\", \"go_rules_dependencies\", \"go_register_toolchains\")\ngo_rules_dependencies()\ngo_register_toolchains()\n\nhttp_archive(\n  name = \"io_bazel_rules_webtesting\",\n  strip_prefix = \"rules_webtesting-master\",\n  urls = [\n    \"https://github.com/bazelbuild/rules_webtesting/archive/master.tar.gz\",\n  ],\n)\nload(\"@io_bazel_rules_webtesting//web:repositories.bzl\", \"browser_repositories\", \"web_test_repositories\")\nweb_test_repositories()\n\ngit_repository(\n  name = \"build_bazel_rules_nodejs\",\n  remote = \"https://github.com/bazelbuild/rules_nodejs.git\",\n  commit = \"d334fd8e2274fb939cf447106dced97472534e80\",\n)\nload(\"@build_bazel_rules_nodejs//:defs.bzl\", \"node_repositories\")\nnode_repositories(package_json = [\"//:package.json\"])\n\ngit_repository(\n    name = \"ts_protoc_gen\",\n    remote = \"https://github.com/improbable-eng/ts-protoc-gen.git\",\n    commit = \"05c52b843edf9420be3a9549d01352dfeff76a5e\",\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\ntypescript_proto_dependencies()\n\ngit_repository(\n  name = \"build_bazel_rules_typescript\",\n  remote = \"https://github.com/bazelbuild/rules_typescript.git\",\n  commit = \"3488d4fb89c6a02d79875d217d1029182fbcd797\",\n)\nload(\"@build_bazel_rules_typescript//:defs.bzl\", \"ts_setup_workspace\")\nts_setup_workspace()\n```   \n\nNow in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nfilegroup(\n  name = \"proto_files\",\n  srcs = glob([\"*.proto\"]),\n)\n\nproto_library(\n  name = \"proto\",\n  srcs = [\n    \":proto_files\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"generate\",\n  proto = \":proto\",\n)\n```\n\n</p></details>\n\n## Contributing\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\nAs mentioned above, this plugin for `protoc` serves two purposes:\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs. \n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport { UserServiceClient, GetUserRequest } from \"../generated/users_pb_service\"\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => { /* ... */ });\n```\n\n## Examples\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples).\n\nTo generate the examples from protos, please run `./generate.sh`\n\n## Gotchas\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.7.8-pre.51f57ea","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-QJ2+mS6Tk950oCuH48KrVfDMsJmNzJDbnCGn9RGeT5cVEtHm1cBb78PcbCI24fgKS0qf4hFnKIuvX3l798+3dA==","shasum":"7821d8fcd8f8f1bb3b645596b9eaf2a183d80e2e","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.7.8-pre.51f57ea.tgz","fileCount":74,"unpackedSize":146414,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbxkRPCRA9TVsSAnZWagAA2KwQAJe+DkOdT4LSskoNxmPn\nz+aRVaLorMpkfoQvJ9QDP0f+AwcIR76ziSsi0AgWbXcl2FMcSuo/VG7t76Po\nL8Mer6S9UZZ31zKan2S6YkFRIxlACdXfJpoIX3Lvv6QfhQFG+fFNIXOBbVlA\ncAZSy3n3qXOZoQn9UrMP5ks3+mzEZ9Ih3v8bHVmM2PDLLMsI5Xn1uoQqGyqV\nAodAeYbrSda/zTKhSIJtIXZFDv8ZpmGT+C09ZAksfp8tW7nuWSLdwqHzCDV/\nTx69kVL57W7eECpKyF5M0y01/cC+iiQW21VKOI+iE6dbEj0Y0xt7yN5bhvdo\nQ9IADDdYJKrEslOJsOmfarqmLeC9vjwpnu10HP1dg90IVdUr/imoh8chZ5NJ\n/2Zt00WDA5ug1JKdva1eysRb0Jn7Otq3AFLXwhw2qWO15ctgQy/iblkU5m3r\nuIExm+ltvdoKkF2SpLVJJ/mIlQ9GnyeTR9woddmBUwQDl9sHDX673HXiidEg\njhbA427kgym8mRM5q4a00tJAQGaPajZq8/07sbIxaEpEF9/L5Szokcou2oJg\n4pfVMnOWidCKSLcLtxN34JLcXhsTVHfKkDYqHDKUbtCqLBXTcfPKqOdG/O1n\noqIlmgi/I+9828sRvambfMnlH4auitRJk4ERd/zHJ1vHR3YEU8/qDavGZneL\njZRD\r\n=Z7OS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAxTzhoXb7fITXpdWO2waG0N9sp6zXMaNmZgwqT0ADkcAiEAzolSJ4yZu3Ej0mChd1SpzqHLZE1KcAH27nktALRGQMw="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.7.8-pre.51f57ea_1539720270781_0.27677782515894056"},"_hasShrinkwrap":false},"0.7.8-pre.217169b":{"name":"ts-protoc-gen","version":"0.7.8-pre.217169b","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","chai":"^3.5.0","grpc-web-client":"^0.6.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"f3c2b3eb2b4afd18d945b00b5e824f51914f4df8","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations \n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build/>bazel\">bazel</a> build environment</summary><p>\n\nInclude the following in your `WORKSPACE`:   \n\n```python\ngit_repository(\n    name = \"io_bazel_rules_go\",\n    commit = \"6bee898391a42971289a7989c0f459ab5a4a84dd\",  # master as of May 10th, 2018\n    remote = \"https://github.com/bazelbuild/rules_go.git\",\n    )\nload(\"@io_bazel_rules_go//go:def.bzl\", \"go_rules_dependencies\", \"go_register_toolchains\")\ngo_rules_dependencies()\ngo_register_toolchains()\n\nhttp_archive(\n  name = \"io_bazel_rules_webtesting\",\n  strip_prefix = \"rules_webtesting-master\",\n  urls = [\n    \"https://github.com/bazelbuild/rules_webtesting/archive/master.tar.gz\",\n  ],\n)\nload(\"@io_bazel_rules_webtesting//web:repositories.bzl\", \"browser_repositories\", \"web_test_repositories\")\nweb_test_repositories()\n\ngit_repository(\n  name = \"build_bazel_rules_nodejs\",\n  remote = \"https://github.com/bazelbuild/rules_nodejs.git\",\n  commit = \"d334fd8e2274fb939cf447106dced97472534e80\",\n)\nload(\"@build_bazel_rules_nodejs//:defs.bzl\", \"node_repositories\")\nnode_repositories(package_json = [\"//:package.json\"])\n\ngit_repository(\n    name = \"ts_protoc_gen\",\n    remote = \"https://github.com/improbable-eng/ts-protoc-gen.git\",\n    commit = \"05c52b843edf9420be3a9549d01352dfeff76a5e\",\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\ntypescript_proto_dependencies()\n\ngit_repository(\n  name = \"build_bazel_rules_typescript\",\n  remote = \"https://github.com/bazelbuild/rules_typescript.git\",\n  commit = \"3488d4fb89c6a02d79875d217d1029182fbcd797\",\n)\nload(\"@build_bazel_rules_typescript//:defs.bzl\", \"ts_setup_workspace\")\nts_setup_workspace()\n```   \n\nNow in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nfilegroup(\n  name = \"proto_files\",\n  srcs = glob([\"*.proto\"]),\n)\n\nproto_library(\n  name = \"proto\",\n  srcs = [\n    \":proto_files\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"generate\",\n  proto = \":proto\",\n)\n```\n\n</p></details>\n\n## Contributing\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\nAs mentioned above, this plugin for `protoc` serves two purposes:\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs. \n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport { UserServiceClient, GetUserRequest } from \"../generated/users_pb_service\"\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => { /* ... */ });\n```\n\n## Examples\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples).\n\nTo generate the examples from protos, please run `./generate.sh`\n\n## Gotchas\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.7.8-pre.217169b","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-yEejGQpV0dzqORFsvtot5XnsS2JEMx4OqUEfsDE3lSnc8ecrV5CLIGPh/7JgFee475VNZ5eRTD26HUtxuXJH/w==","shasum":"555a24469e6cefbc93a54af36e3af673377a9823","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.7.8-pre.217169b.tgz","fileCount":74,"unpackedSize":146512,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJby6H4CRA9TVsSAnZWagAAwxwP/1skNlVhEFJ0Gc37V3aN\neZjP1jXvux6li2z4JjkvKBeHm7jEGI6VIhgvHVTfS7gkHENJnx7tbE4lf1Ar\nYVToN0gmhHq/Q/UYbDU2mjr8sfb8SCX4xkoyqgs2nZv6zidPepYSNmONLjJ2\nqSv3+A713bNPvpWPbJfzO/nkHJdeiI0Pcqif7NGSQmKueiTwwzXXI4lDZXli\nohB2f4qy8HryIiPTTARRMgritxUPFamGK9808dhIFbifgj+qnj7W+LmRZM2p\nsUBNYyhOIXpr8l3ozg9z/WrqJr/EX2HJSHiVairiKDJBC0GvYyCrgMeySdGr\n2tfhYskQrO9MkF9ldHn06M9VcoF7KRrcxb2hj1W3ANYWK8L+khNiQUUbjsiJ\nB4XXywTnCqVhC4zHMfg+qlldUu0ViCpmaDCmo+ZRq4tVL3k72E+fGnwzzwr8\n+Ba4ExarHOU1StkLGbxznv31JL4jepDbwgDMYjI4rRwEPWzV5Wpta8NYOxrF\nbM2h7SwPORZcoOJQIvYIfM7aTgrA9q1jjCqWhxZKxfYxmTEmpxsiam5opCsw\nYzTA5OlA18yfsIPa13uHj/lr9YIcsJ+luTd4yTWek1EgqSyALnDySYVToW0W\nTff5t/XI874Y6UU+UvySBKetGghii5mmxiLRECq665JKezqATcyLfVLSjLYm\n2P7b\r\n=ulT1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBEoxLog+7D9fVFuPnNrCz4xteWHVbJALTi16AKkC2iZAiEAyk+whOWNcQoV1sc3hWQpLOL5wgFHri4tQ7HTCu+eSJk="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.7.8-pre.217169b_1540071927430_0.6355620015651213"},"_hasShrinkwrap":false},"0.7.8-pre.b4e921a":{"name":"ts-protoc-gen","version":"0.7.8-pre.b4e921a","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","chai":"^3.5.0","grpc-web-client":"^0.7.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"006e9d96c31cee332f651039bc992ef57143a654","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations \n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build/>bazel\">bazel</a> build environment</summary><p>\n\nInclude the following in your `WORKSPACE`:   \n\n```python\ngit_repository(\n    name = \"io_bazel_rules_go\",\n    commit = \"6bee898391a42971289a7989c0f459ab5a4a84dd\",  # master as of May 10th, 2018\n    remote = \"https://github.com/bazelbuild/rules_go.git\",\n    )\nload(\"@io_bazel_rules_go//go:def.bzl\", \"go_rules_dependencies\", \"go_register_toolchains\")\ngo_rules_dependencies()\ngo_register_toolchains()\n\nhttp_archive(\n  name = \"io_bazel_rules_webtesting\",\n  strip_prefix = \"rules_webtesting-master\",\n  urls = [\n    \"https://github.com/bazelbuild/rules_webtesting/archive/master.tar.gz\",\n  ],\n)\nload(\"@io_bazel_rules_webtesting//web:repositories.bzl\", \"browser_repositories\", \"web_test_repositories\")\nweb_test_repositories()\n\ngit_repository(\n  name = \"build_bazel_rules_nodejs\",\n  remote = \"https://github.com/bazelbuild/rules_nodejs.git\",\n  commit = \"d334fd8e2274fb939cf447106dced97472534e80\",\n)\nload(\"@build_bazel_rules_nodejs//:defs.bzl\", \"node_repositories\")\nnode_repositories(package_json = [\"//:package.json\"])\n\ngit_repository(\n    name = \"ts_protoc_gen\",\n    remote = \"https://github.com/improbable-eng/ts-protoc-gen.git\",\n    commit = \"05c52b843edf9420be3a9549d01352dfeff76a5e\",\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\ntypescript_proto_dependencies()\n\ngit_repository(\n  name = \"build_bazel_rules_typescript\",\n  remote = \"https://github.com/bazelbuild/rules_typescript.git\",\n  commit = \"3488d4fb89c6a02d79875d217d1029182fbcd797\",\n)\nload(\"@build_bazel_rules_typescript//:defs.bzl\", \"ts_setup_workspace\")\nts_setup_workspace()\n```   \n\nNow in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nfilegroup(\n  name = \"proto_files\",\n  srcs = glob([\"*.proto\"]),\n)\n\nproto_library(\n  name = \"proto\",\n  srcs = [\n    \":proto_files\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"generate\",\n  proto = \":proto\",\n)\n```\n\n</p></details>\n\n## Contributing\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\nAs mentioned above, this plugin for `protoc` serves two purposes:\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs. \n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport { UserServiceClient, GetUserRequest } from \"../generated/users_pb_service\"\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => { /* ... */ });\n```\n\n## Examples\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples).\n\nTo generate the examples from protos, please run `./generate.sh`\n\n## Gotchas\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.7.8-pre.b4e921a","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-yjlu9mPs8fnnvPAG6TrxsS3lnjclLUD8FPyRvTCQ2RNZpSN1P9cq6+XoMyO8/M1OKy+Ye2SVmIKmpzLgHZXJWg==","shasum":"0ffe14cd1eaa5c8757ac5421b5dec276549d0556","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.7.8-pre.b4e921a.tgz","fileCount":74,"unpackedSize":146346,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6X3/CRA9TVsSAnZWagAAkgYP/ialnLBbYiOkqgkWvLx9\nyi4/5EuNpFSihXhTbU0QRFMnLHuAQXdsuKPkYBUyCR1dDbmsNu0YdyUocDoO\nm+XjEvu57nekskALbd1DwxNSg5zuNEKUfM475gQOzYoIgoMDwN4DDcdEC9Qj\n36Ig8NdG2TA1bVUDPZOhC1iXmsaZ6G+gMJwn36f6bRh8Nk8NKVH74RE6wiTT\nx1Snvtq/NDIY8Cy1xcNywTEIriijY30IoCpcVHAg6aLVLFYH5sQg4VFpkHMV\n6oMjo5dOdvJ1EX5yEvc8uifG1/oT3yagFgTVCKupO5yU/p9Xoe/5EJ30ViMr\nP9CJMvBfq2LY/IGZQA/NTA0nL/Na7V8StFYGzEKJ05QfMvGSxf0tEUYDY+e1\nAnLYkyjJtyEAvZ5fC7zSYHTyS5lg6BFFSuXgMpZ8quFhvAxrWD1OKST6WNnr\nkV5DGsozamvwvuIihQIqsm0rsBlFQ4jM96E/LnqMNAicDy269trEfTHMtiCq\nwuWXmYguQXzlNiR6ZQngkNXBPLfXGkFK8n+MjBzOWSqyEFTSTw83xISW5Jo3\nnAnMxarwe10iBeqZBbYm1XPmutafiewdpLrvkH+0MAGM7NpkAVnTnSxUzYUM\ntQQyEWlgU/+1OABlPwtRYRS4obTniYtDO+H6G1vKn1x+mX521L4a8TVcZ0jQ\nvfdy\r\n=OZfA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDgm9yX1IOgcdsygo11CmmgagPKht6LXNBKppgK51wBaAIhAPrnmH2pJHZTRiba1EhiwLQilPmF1252eX7RwSkMr83n"}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.7.8-pre.b4e921a_1542028798346_0.00876391910086105"},"_hasShrinkwrap":false},"0.8.1-pre.a7b6422":{"name":"ts-protoc-gen","version":"0.8.1-pre.a7b6422","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","chai":"^3.5.0","grpc-web-client":"^0.7.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"f8e12b1007c773f70834f4f7b64e0ac0f32871e8","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations \n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build/>bazel\">bazel</a> build environment</summary><p>\n\nInclude the following in your `WORKSPACE`:   \n\n```python\ngit_repository(\n    name = \"io_bazel_rules_go\",\n    commit = \"6bee898391a42971289a7989c0f459ab5a4a84dd\",  # master as of May 10th, 2018\n    remote = \"https://github.com/bazelbuild/rules_go.git\",\n    )\nload(\"@io_bazel_rules_go//go:def.bzl\", \"go_rules_dependencies\", \"go_register_toolchains\")\ngo_rules_dependencies()\ngo_register_toolchains()\n\nhttp_archive(\n  name = \"io_bazel_rules_webtesting\",\n  strip_prefix = \"rules_webtesting-master\",\n  urls = [\n    \"https://github.com/bazelbuild/rules_webtesting/archive/master.tar.gz\",\n  ],\n)\nload(\"@io_bazel_rules_webtesting//web:repositories.bzl\", \"browser_repositories\", \"web_test_repositories\")\nweb_test_repositories()\n\ngit_repository(\n  name = \"build_bazel_rules_nodejs\",\n  remote = \"https://github.com/bazelbuild/rules_nodejs.git\",\n  commit = \"d334fd8e2274fb939cf447106dced97472534e80\",\n)\nload(\"@build_bazel_rules_nodejs//:defs.bzl\", \"node_repositories\")\nnode_repositories(package_json = [\"//:package.json\"])\n\ngit_repository(\n    name = \"ts_protoc_gen\",\n    remote = \"https://github.com/improbable-eng/ts-protoc-gen.git\",\n    commit = \"05c52b843edf9420be3a9549d01352dfeff76a5e\",\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\ntypescript_proto_dependencies()\n\ngit_repository(\n  name = \"build_bazel_rules_typescript\",\n  remote = \"https://github.com/bazelbuild/rules_typescript.git\",\n  commit = \"3488d4fb89c6a02d79875d217d1029182fbcd797\",\n)\nload(\"@build_bazel_rules_typescript//:defs.bzl\", \"ts_setup_workspace\")\nts_setup_workspace()\n```   \n\nNow in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nfilegroup(\n  name = \"proto_files\",\n  srcs = glob([\"*.proto\"]),\n)\n\nproto_library(\n  name = \"proto\",\n  srcs = [\n    \":proto_files\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"generate\",\n  proto = \":proto\",\n)\n```\n\n</p></details>\n\n## Contributing\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\nAs mentioned above, this plugin for `protoc` serves two purposes:\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs. \n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport { UserServiceClient, GetUserRequest } from \"../generated/users_pb_service\"\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => { /* ... */ });\n```\n\n## Examples\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples).\n\nTo generate the examples from protos, please run `./generate.sh`\n\n## Gotchas\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.8.1-pre.a7b6422","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-aeZ/+T3jPBtne86QJEsiGvsixbi/a9EKAdhQ5N2Gr4KVTeD0dp6RcEgRixp+LAX/Q51Qrn3p7s8Ea1eucXwMRA==","shasum":"d0ccee35d6458cbc5425f356788e9b09a0ba0a12","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.8.1-pre.a7b6422.tgz","fileCount":74,"unpackedSize":146889,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6X/KCRA9TVsSAnZWagAAtv0P/jswdSvybrip9zHz1ia4\nASdKkuOaqCv+ynA9vOjFNOKTO03jE7QVYK/XBRV4fn9ls5+WKSy+3YPbSEKd\n5S0ldRXJQtD902GBUDO9yNo/uOJLKToVpoZ1AUI+VhzmEV4YlsnCeLB5s/xU\nWqvuEnk9M+C7yRVZxJT/o7u446p2gRXAfeXOsIQ+Er//qswJtzgIVBN+2cBt\nsTprySNTHZ5JrRfskDO0mzbfioqjseuzYkwCepQZqcJyIwT2mnQPaHnAfhPy\ni62YhdfDahNJjLTjXudjOQqw7pEOOIZm/Em9v4BmQqsGI8oi4WXTlmXAny2R\nAdovZc2x33AsAKuSiUG80Ag8kP/DdlrwJ6zvY4L0G1zEW076WhvLIjXMs29J\n0bH0DAq93azLD1+XoiPrtrHyzGjSXrRWDZmj8GMmZhtxdTXaa+5r56zxDlwM\nShQyrJUmDBLCH8zOYI+8ilkIDO4KQ0jWZbVWrzrlYyaobwkR5ENDT03h8Q9i\nZeJvP1LFCyz3n4SdpmB2YK9CxvdGyj0O8VqhwrODvXQNZiitbgS/+ijgYt9k\nDhSpbe3KyqQFc6tdfJ+ce4ANEDg5TL8sTh0GhenkCRNwmGMO5rgMSygcfkzm\ncGRho9U19tB54/US5kLYsZJqBujrirSHG/tEWP8SdgoySwk40vIrCFA9gERz\nW82R\r\n=vs3h\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCxvLiI/+5USAGOIIuLImMc3+IUVsJUQ4kigZ24sTaHigIhANE54/fKIFqGt7tLyoVFL0glsKiCalxM1YBIGgElJbNS"}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.8.1-pre.a7b6422_1542029257983_0.08803973526723574"},"_hasShrinkwrap":false},"0.8.0":{"name":"ts-protoc-gen","version":"0.8.0","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","chai":"^3.5.0","grpc-web-client":"^0.7.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"af66f87a17f5280d89e67d44ae4e7ef28f447bf4","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.8.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-LUFM4Jy3qMSVyRf5ql973cJjltS98MiCz8kPf1Rc9AC9BeLu0WJfoHLf0Tvx2cGH0jSK9BpA0o1tHQQfjeO47Q==","shasum":"2a9a31ee8a4d4760c484f1d0c7199633afaa5e3e","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.8.0.tgz","fileCount":74,"unpackedSize":146863,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJb6YFhCRA9TVsSAnZWagAASCwQAI9ZhOGldv5NW3XP0H+L\ntJc0/2WTziT17VM8sT6y8yRAqWCtjzIkuXtbZ+uZaXBJPCDqqM3bPThz4mJm\nq5jHwhMeru9BhPOwDSfa5EY2yyVtkcrQU/vdTnWU63Z8RcETxm2EsCE/kMnZ\nq1+W6FwYfGOuI+WGMFkO5ErwZ7PG5ZNZFufMSDw3o5pZqTNNPUQqKqSveTaI\nHNb2WPmfQlj+l1nIPAMDiZg8XE/+AJzajK75EyLskOLKs1EJbTVPPeWYbI4O\nIcOocDPk3bk5SfqTgYfP4pRd2dtKzqwIX6ijyLH1CpKKJ9kZHY3d+O9xkCt0\nSfgdMfBFbw+otZCH+M6k4SfBKGX7puiMsbWScURqnHWkYydUddkKSrIuDR5h\n7+/ygRwiOdjMivJdP3O15bm/Y6ek3J7YLW3Kg4lF077qmrvbYfSg5iG84gCe\nEeib9hJEieDCVJwtzW/PKpAZ0H+26gHIBExmAf2eMXA/9rBDwrbwEQTv5JxO\ne/bL5xf2lIbulaUUNKIwxEFFMu3VYzFFS0+a3IbEn2pDFc/NgWIKvo8E+Y0/\nId1VaEQyD225QDimQ44YjsB+L0TLedZ4JxC4AAI/mkY2saZh1zEo+p30dYBv\n6WhPmoexQ8ZbcXtcUvwLycZ3QKV0p2Mcq9+fRK4BRDfoXbZ7pRWMG+Kj9//p\nSBsG\r\n=QQm8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDpF6QmYm21vzATfU74UGojsXIQ+nBT4sonE0GDLRBHeAIhANlR673k47+53ETCZ+EgQCoXCFnstiG2Tovvt99eF2dU"}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.8.0_1542029664821_0.363419513397111"},"_hasShrinkwrap":false},"0.8.1-pre.14d69f6":{"name":"ts-protoc-gen","version":"0.8.1-pre.14d69f6","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{},"devDependencies":{"@bazel/karma":"0.21.0","@bazel/typescript":"0.21.0","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/jasmine":"^2.8.9","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","google-protobuf":"^3.6.1","grpc-web-client":"^0.7.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"d5eaa9de6608088aee060117cb46838759be1de7","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations \n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build/>bazel\">bazel</a> build environment</summary><p>\n\nInclude the following in your `WORKSPACE`:   \n\n```python\ngit_repository(\n    name = \"io_bazel_rules_go\",\n    commit = \"6bee898391a42971289a7989c0f459ab5a4a84dd\",  # master as of May 10th, 2018\n    remote = \"https://github.com/bazelbuild/rules_go.git\",\n    )\nload(\"@io_bazel_rules_go//go:def.bzl\", \"go_rules_dependencies\", \"go_register_toolchains\")\ngo_rules_dependencies()\ngo_register_toolchains()\n\nhttp_archive(\n  name = \"io_bazel_rules_webtesting\",\n  strip_prefix = \"rules_webtesting-master\",\n  urls = [\n    \"https://github.com/bazelbuild/rules_webtesting/archive/master.tar.gz\",\n  ],\n)\nload(\"@io_bazel_rules_webtesting//web:repositories.bzl\", \"browser_repositories\", \"web_test_repositories\")\nweb_test_repositories()\n\ngit_repository(\n  name = \"build_bazel_rules_nodejs\",\n  remote = \"https://github.com/bazelbuild/rules_nodejs.git\",\n  commit = \"d334fd8e2274fb939cf447106dced97472534e80\",\n)\nload(\"@build_bazel_rules_nodejs//:defs.bzl\", \"node_repositories\")\nnode_repositories(package_json = [\"//:package.json\"])\n\ngit_repository(\n    name = \"ts_protoc_gen\",\n    remote = \"https://github.com/improbable-eng/ts-protoc-gen.git\",\n    commit = \"05c52b843edf9420be3a9549d01352dfeff76a5e\",\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\ntypescript_proto_dependencies()\n\ngit_repository(\n  name = \"build_bazel_rules_typescript\",\n  remote = \"https://github.com/bazelbuild/rules_typescript.git\",\n  commit = \"3488d4fb89c6a02d79875d217d1029182fbcd797\",\n)\nload(\"@build_bazel_rules_typescript//:defs.bzl\", \"ts_setup_workspace\")\nts_setup_workspace()\n```   \n\nNow in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nfilegroup(\n  name = \"proto_files\",\n  srcs = glob([\"*.proto\"]),\n)\n\nproto_library(\n  name = \"proto\",\n  srcs = [\n    \":proto_files\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"generate\",\n  proto = \":proto\",\n)\n```\n\n</p></details>\n\n## Contributing\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\nAs mentioned above, this plugin for `protoc` serves two purposes:\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs. \n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport { UserServiceClient, GetUserRequest } from \"../generated/users_pb_service\"\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => { /* ... */ });\n```\n\n## Examples\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples).\n\nTo generate the examples from protos, please run `./generate.sh`\n\n## Gotchas\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.8.1-pre.14d69f6","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-+f6+HqSQxyfbKM005m6nKQ3XaC8HaLm6Nz9ZaqsolJiKACT+CYLCDd+G2JFZ0/1n4sEiOLRphFoJZ8Y0Jh+AQA==","shasum":"7f165adb5572057e778232bad4b402c4f4c47cfe","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.8.1-pre.14d69f6.tgz","fileCount":75,"unpackedSize":266800,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcADr+CRA9TVsSAnZWagAAKhUP/0StSjgpFF8ZcG4QSDQR\nt8lM0mNkQNEMwjOO8yXoHTKdYd+mpsVGdD3a7vK9WCdyRmxhgRhlT0GC5eqz\nW+foULD7Yb041VWTgK+JIJw77taWx9H22YEIvPWVAzNfPTBfUznc7tWvHGbV\n5Nq6QrYo3jFDCebVoAmyKrtDW8d+ncd7bl7M4sUxi8of8B5kj9mJDnj2pi7E\nDwErlk67eezgf65hyI2OxlumZcGdRik74XGvqvXHdJa9Oyg/jpr8pwmmqdjS\nQWrW7hnchd71rNHKOyjA9QEh2bUmt/3La7f7afz+zIBaF7Zm2sOYV5X4/yOv\nUaImQ8tVp4JaRxRqS5jm2DZFuzYot/9KBMyDZDTc/p4s7T7O4AIDDsx78hoa\n8LGQrHuYO0K+fyiIA3MMxPZ4eoQciWgk9bmKgWaNwJWlEyOCXYqnrlwRM4vZ\nKJEOGJtsYu0QYc2oXO2ndl1RzX93fXAKHyPMuE8HiZeaTSyFFKux5hbUhMf3\nre4AmrVGP0QkLQnZQmprEp/BPqMz+P5WTgkwzhVSb86QeEXL49UkcY+3gh2Y\nNyJP1NqTMHEE8wr6L+ftuK3Z28yKNydpAKcoSkTVQzN9N6ZStVKnEbC+lB6w\npykRf9tU5qWm0Bbci/m8pTA3TREgg98vtSMgP2xbwX82FKjPvFsWYcsvK81h\n7Fvh\r\n=K+Qv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDA0ik7b7I6tOg27RzSDWu7mw85KrIm9JypONcn2vU8XgIgMhNaSqWZ5I9axvMV/0Zma1Yw32QPyKvl7T/MDl0qdD0="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.8.1-pre.14d69f6_1543518973647_0.6445695668072109"},"_hasShrinkwrap":false},"0.8.1-pre.f127046":{"name":"ts-protoc-gen","version":"0.8.1-pre.f127046","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{},"devDependencies":{"@bazel/karma":"0.21.0","@bazel/typescript":"0.21.0","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/jasmine":"^2.8.9","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","google-protobuf":"^3.6.1","grpc-web-client":"^0.7.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"5e89daa72d65975cadc49cd3acee2f11ef91f978","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations \n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build/>bazel\">bazel</a> build environment</summary><p>\n\nInclude the following in your `WORKSPACE` - _Most of this setup is for\n[rules_typescript](https://github.com/bazelbuild/rules_typescript), see their instructions for more\ninfo:_\n\n```python\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n\nhttp_archive(\n    name = \"build_bazel_rules_typescript\",\n    sha256 = \"e4f51c408ed3278a3a1dd227564a69f293ae2ac4ae1564b3a6d2637ae9447b47\",\n    strip_prefix = \"rules_typescript-0.21.0\",\n    urls = [\"https://github.com/bazelbuild/rules_typescript/archive/0.21.0.zip\"],\n)\n\nhttp_archive(\n    name = \"ts_protoc_gen\",\n    # NOTE: Update these values to the latest version\n    sha256 = \"355bd8e7a3d4889a3fb222366ac3427229acc968455670378f8ffe1b4bfc5a95\",\n    strip_prefix = \"ts-protoc-gen-14d69f6203c291f15017a8c0abbb1d4b52b00b64\",\n    urls = [\"https://github.com/improbable-eng/ts-protoc-gen/archive/14d69f6203c291f15017a8c0abbb1d4b52b00b64.zip\"],\n)\n\nload(\"@build_bazel_rules_typescript//:package.bzl\", \"rules_typescript_dependencies\")\n\nrules_typescript_dependencies()\n\nload(\"@build_bazel_rules_typescript//:defs.bzl\", \"ts_setup_workspace\")\n\nts_setup_workspace()\n\nload(\"@build_bazel_rules_nodejs//:defs.bzl\", \"node_repositories\", \"yarn_install\")\n\nnode_repositories()\n\nyarn_install(\n    name = \"npm\",\n    package_json = \"//:package.json\",\n    yarn_lock = \"//:yarn.lock\",\n)\n\nload(\"@io_bazel_rules_go//go:def.bzl\", \"go_register_toolchains\", \"go_rules_dependencies\")\n\ngo_rules_dependencies()\n\ngo_register_toolchains()\n\nload(\"@io_bazel_rules_webtesting//web:repositories.bzl\", \"browser_repositories\", \"web_test_repositories\")\n\nweb_test_repositories()\n\nbrowser_repositories(\n    chromium = True,\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\n\ntypescript_proto_dependencies()\n```\n\nAlso make sure you have the following in your `package.json`:\n\n```json\n{\n  \"dependencies\": {\n    \"google-protobuf\": \"^3.6.1\",\n    \"grpc-web-client\": \"0.7.0\",\n    \"browser-headers\": \"^0.4.1\"\n  },\n  \"devDependencies\": {\n    \"@bazel/karma\": \"^0.21.0\",\n    \"@bazel/typescript\": \"^0.21.0\",\n    \"@types/google-protobuf\": \"^3.2.7\",\n    \"typescript\": \"^3.1.1\"\n  }\n}\n```\n\n> Run `yarn install` to generate the `yarn.lock` file.\n\nFinally, in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nproto_library(\n  name = \"test_proto\",\n  srcs = [\n    \"test.proto\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"test_ts_proto\",\n  proto = \":test_proto\",\n)\n```\n\nYou can use the `test_ts_proto` as a `dep` in other `ts_library` targets. However, you will need to\ninclude `google-protobuf`, `grpc-web-client`, and `browser-headers` at runtime yourself. See \n`//test/bazel:pizza_service_proto_test_suite` for an example.\n\n</p></details>\n\n## Contributing\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\nAs mentioned above, this plugin for `protoc` serves two purposes:\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files) \nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs. \n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport { UserServiceClient, GetUserRequest } from \"../generated/users_pb_service\"\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => { /* ... */ });\n```\n\n## Examples\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples).\n\nTo generate the examples from protos, please run `./generate.sh`\n\n## Gotchas\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.8.1-pre.f127046","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-36pBz/ME307bJW6QDa03mIO72DW4i/i+JuFZ8fY3R42UMbUQJln6TaoujAHtg/ALpMI3c+F6zRx8zPp1h2CxHw==","shasum":"1a641c10cea6405cb6636826fd9830b5e7a864e2","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.8.1-pre.f127046.tgz","fileCount":75,"unpackedSize":267615,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcAwpOCRA9TVsSAnZWagAAfcEP/jKV3p+BMNx4DXGpO0Xm\nEzZbUOB66qjY94twbC6OVRqLzQZ9bi462JL5Z1RbI5LDcFG5lJV1MscPbwdL\nTchGOGSIxd6ku17yYp0SUC3b9uWJ7W4PG++F/Ly3y+XppmH2cdr1peKwhrC3\nmABhs/2Ld4XIUsXlVEJ8A96U2T+8G1ikZPEJMcl+3/rM6hgHZPmryRPtGZLZ\nwmlBiUzEezT3q5iahHnqoh++VkB4FE9ipJzbTo3loz7dAgqQ1++omWw/uPls\n9hTi1pt/y/9H1u1jBtzJ8cqQRFUSYoK/ULKTAKR6ZdXkoPej0+p9A0WMvsf4\nvjx9T11WFOwwD8qba8w1pFZVomMhe4CWT/Gw+ns9aOnaaKHOu5nODUB3M3D3\n60ndZB+M7IC3dssNWrctD+7vpUiKuNgjlaW2de+gQaUQhWGNZCF8kAJq8FE1\n1tkbxUBBqntsCqGN5t1ky8WCppnt46lDQ7MTEXsqtXb+5PnMevL/L3CkcZqB\nS21Ng7RBgGVc3SEQllhnhdkqBOHS3V/TmeiONUwCBA4j3NQ161rKY7p4u4dU\nyygadTCWKHKGAv+H4j9FOcB6X1B9FlLNl3tETaJOyIcWMp/eMP7bssHdgiMW\nuj5ZebeuHEgVfwmpMJ1MRVbKu/rjHcoHp1L//p1lHJxbQbP629SjjLv6uySe\n1O4I\r\n=rFaN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFkjFv1IecUS2TE1filL4O4eFNf96oZ7QiCnG2CSD2awAiBNhmfoYHQVxeaC14qOKLiNiCHiot0QnCTnekP8T7a93g=="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.8.1-pre.f127046_1543703118098_0.7133511325074062"},"_hasShrinkwrap":false},"0.8.1-pre.dd6273b":{"name":"ts-protoc-gen","version":"0.8.1-pre.dd6273b","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{},"devDependencies":{"@bazel/karma":"0.21.0","@bazel/typescript":"0.21.0","@improbable-eng/grpc-web":"^0.8.0","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/jasmine":"^2.8.9","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","google-protobuf":"^3.6.1","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"9a33af91230c3abfe3ca1d7a2dc0fe401c24b686","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations\n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\n\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build/>bazel\">bazel</a> build environment</summary><p>\n\nInclude the following in your `WORKSPACE` - _Most of this setup is for\n[rules_typescript](https://github.com/bazelbuild/rules_typescript), see their instructions for more\ninfo:_\n\n```python\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n\nhttp_archive(\n    name = \"build_bazel_rules_typescript\",\n    sha256 = \"e4f51c408ed3278a3a1dd227564a69f293ae2ac4ae1564b3a6d2637ae9447b47\",\n    strip_prefix = \"rules_typescript-0.21.0\",\n    urls = [\"https://github.com/bazelbuild/rules_typescript/archive/0.21.0.zip\"],\n)\n\nhttp_archive(\n    name = \"ts_protoc_gen\",\n    # NOTE: Update these values to the latest version\n    sha256 = \"355bd8e7a3d4889a3fb222366ac3427229acc968455670378f8ffe1b4bfc5a95\",\n    strip_prefix = \"ts-protoc-gen-14d69f6203c291f15017a8c0abbb1d4b52b00b64\",\n    urls = [\"https://github.com/improbable-eng/ts-protoc-gen/archive/14d69f6203c291f15017a8c0abbb1d4b52b00b64.zip\"],\n)\n\nload(\"@build_bazel_rules_typescript//:package.bzl\", \"rules_typescript_dependencies\")\n\nrules_typescript_dependencies()\n\nload(\"@build_bazel_rules_typescript//:defs.bzl\", \"ts_setup_workspace\")\n\nts_setup_workspace()\n\nload(\"@build_bazel_rules_nodejs//:defs.bzl\", \"node_repositories\", \"yarn_install\")\n\nnode_repositories()\n\nyarn_install(\n    name = \"npm\",\n    package_json = \"//:package.json\",\n    yarn_lock = \"//:yarn.lock\",\n)\n\nload(\"@io_bazel_rules_go//go:def.bzl\", \"go_register_toolchains\", \"go_rules_dependencies\")\n\ngo_rules_dependencies()\n\ngo_register_toolchains()\n\nload(\"@io_bazel_rules_webtesting//web:repositories.bzl\", \"browser_repositories\", \"web_test_repositories\")\n\nweb_test_repositories()\n\nbrowser_repositories(\n    chromium = True,\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\n\ntypescript_proto_dependencies()\n```\n\nAlso make sure you have the following in your `package.json`:\n\n```json\n{\n  \"dependencies\": {\n    \"google-protobuf\": \"^3.6.1\",\n    \"@improbable-eng/grpc-web\": \"0.8.0\",\n    \"browser-headers\": \"^0.4.1\"\n  },\n  \"devDependencies\": {\n    \"@bazel/karma\": \"^0.21.0\",\n    \"@bazel/typescript\": \"^0.21.0\",\n    \"@types/google-protobuf\": \"^3.2.7\",\n    \"typescript\": \"^3.1.1\"\n  }\n}\n```\n\n> Run `yarn install` to generate the `yarn.lock` file.\n\nFinally, in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nproto_library(\n  name = \"test_proto\",\n  srcs = [\n    \"test.proto\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"test_ts_proto\",\n  proto = \":test_proto\",\n)\n```\n\nYou can use the `test_ts_proto` as a `dep` in other `ts_library` targets. However, you will need to\ninclude `google-protobuf`, `@improbable-eng/grpc-web`, and `browser-headers` at runtime yourself. See\n`//test/bazel:pizza_service_proto_test_suite` for an example.\n\n</p></details>\n\n## Contributing\n\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\n\nAs mentioned above, this plugin for `protoc` serves two purposes:\n\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\n\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport {\n  UserServiceClient,\n  GetUserRequest\n} from \"../generated/users_pb_service\";\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => {\n  /* ... */\n});\n```\n\n## Examples\n\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples).\n\nTo generate the examples from protos, please run `./generate.sh`\n\n## Gotchas\n\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.8.1-pre.dd6273b","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-g/iEXiScufDa2FzFd68Ko/Ff3Xc2kGQmV1p0pLU9hyP/OoQySAfSIXR3RTThXYSDKk7jEQz5wUm/9sODPVI8vA==","shasum":"147bd26b81e09f5e7d77e340dfcc99f9f678182e","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.8.1-pre.dd6273b.tgz","fileCount":75,"unpackedSize":267793,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcOiKnCRA9TVsSAnZWagAA6EAP/3qoomzx6uTYDxlsmx7v\nQuaYHsUo95iJyayuL5VDmbjs2/NACLa4oarjAruGZ8GdCdVRVABoHLAgom+v\nLtoIwD+/CAOGIh8sHQE9o36+Z4wxpqHlLyB2vxAMC+W2Ibf+VUO+GWgeeElc\nWLJ9Z8xw87YmrVTwljfJmKG13ZsnydSp12okLaKaF9i9Z/kqPcCCIqhQtFtY\nmQcfxB3yMMCOrDfxot04VEB2baK0alj4SMNHHL0QukIto/6RdZryKeb1JHye\nw5oybbF+jGHKhj5P9wELm1cB7EIbwHA9a0JP5hJ49XAaeIW1guDkhOdcSuBW\nGwk0Iw4QV+hxAGUj3eOH9FsHEjLIlVp0Au/aK4QqgQZvKfSwzjWFq5FUuP1t\n8XZ4y5+e1gFPzJRTkMWhIL5sLRwPhYeh21QrXRYbOzWvLNoRoT0waVt5aIOv\nftlenA/aKwHAdUFioJ0z716kecVXE6Q+Zswz9PXrxGw8KHAT2AFZj4+MkrBg\ni7u7DsJgzNb5kUb+9sy1QhAlbK2BtLS3JApxSROXWkPRSpZiAb3IucPBGegw\nnTcSSmeLsiWoTLFfGAPwfcE72gf25/W26nVGUSM/qL3aPQMMwNuKJ84bOMrd\n+qbChJbKbdC4ngGtdyIPjU6BfK3fwFm6qglAchaDbyCMXk3ofOzZ3z5h4y9p\nJRzO\r\n=QzJD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA/qLseKkHZEtohrsIOENBdFRxs8/b2vNFqA3CA6R7d8AiEApyNCtfPLd79TJLk1m0VWDCFPkIBi0Vhd6qyrY9gEZXE="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.8.1-pre.dd6273b_1547313831086_0.11434402214344885"},"_hasShrinkwrap":false},"0.8.1-pre.9c8f487":{"name":"ts-protoc-gen","version":"0.8.1-pre.9c8f487","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{},"devDependencies":{"@bazel/karma":"0.21.0","@bazel/typescript":"0.21.0","@improbable-eng/grpc-web":"^0.8.0","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/jasmine":"^2.8.9","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","google-protobuf":"^3.6.1","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"4ea468cab893de6f31c9f43663f5d88ec56f3534","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations\n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\n\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build/>bazel\">bazel</a> build environment</summary><p>\n\nInclude the following in your `WORKSPACE` - _Most of this setup is for\n[rules_typescript](https://github.com/bazelbuild/rules_typescript), see their instructions for more\ninfo:_\n\n```python\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n\nhttp_archive(\n    name = \"build_bazel_rules_typescript\",\n    sha256 = \"e4f51c408ed3278a3a1dd227564a69f293ae2ac4ae1564b3a6d2637ae9447b47\",\n    strip_prefix = \"rules_typescript-0.21.0\",\n    urls = [\"https://github.com/bazelbuild/rules_typescript/archive/0.21.0.zip\"],\n)\n\nhttp_archive(\n    name = \"ts_protoc_gen\",\n    # NOTE: Update these values to the latest version\n    sha256 = \"355bd8e7a3d4889a3fb222366ac3427229acc968455670378f8ffe1b4bfc5a95\",\n    strip_prefix = \"ts-protoc-gen-14d69f6203c291f15017a8c0abbb1d4b52b00b64\",\n    urls = [\"https://github.com/improbable-eng/ts-protoc-gen/archive/14d69f6203c291f15017a8c0abbb1d4b52b00b64.zip\"],\n)\n\nload(\"@build_bazel_rules_typescript//:package.bzl\", \"rules_typescript_dependencies\")\n\nrules_typescript_dependencies()\n\nload(\"@build_bazel_rules_typescript//:defs.bzl\", \"ts_setup_workspace\")\n\nts_setup_workspace()\n\nload(\"@build_bazel_rules_nodejs//:defs.bzl\", \"node_repositories\", \"yarn_install\")\n\nnode_repositories()\n\nyarn_install(\n    name = \"npm\",\n    package_json = \"//:package.json\",\n    yarn_lock = \"//:yarn.lock\",\n)\n\nload(\"@io_bazel_rules_go//go:def.bzl\", \"go_register_toolchains\", \"go_rules_dependencies\")\n\ngo_rules_dependencies()\n\ngo_register_toolchains()\n\nload(\"@io_bazel_rules_webtesting//web:repositories.bzl\", \"browser_repositories\", \"web_test_repositories\")\n\nweb_test_repositories()\n\nbrowser_repositories(\n    chromium = True,\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\n\ntypescript_proto_dependencies()\n```\n\nAlso make sure you have the following in your `package.json`:\n\n```json\n{\n  \"dependencies\": {\n    \"google-protobuf\": \"^3.6.1\",\n    \"@improbable-eng/grpc-web\": \"0.8.0\",\n    \"browser-headers\": \"^0.4.1\"\n  },\n  \"devDependencies\": {\n    \"@bazel/karma\": \"^0.21.0\",\n    \"@bazel/typescript\": \"^0.21.0\",\n    \"@types/google-protobuf\": \"^3.2.7\",\n    \"typescript\": \"^3.1.1\"\n  }\n}\n```\n\n> Run `yarn install` to generate the `yarn.lock` file.\n\nFinally, in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nproto_library(\n  name = \"test_proto\",\n  srcs = [\n    \"test.proto\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"test_ts_proto\",\n  proto = \":test_proto\",\n)\n```\n\nYou can use the `test_ts_proto` as a `dep` in other `ts_library` targets. However, you will need to\ninclude `google-protobuf`, `@improbable-eng/grpc-web`, and `browser-headers` at runtime yourself. See\n`//test/bazel:pizza_service_proto_test_suite` for an example.\n\n</p></details>\n\n## Contributing\n\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\n\nAs mentioned above, this plugin for `protoc` serves two purposes:\n\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\n\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport {\n  UserServiceClient,\n  GetUserRequest\n} from \"../generated/users_pb_service\";\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => {\n  /* ... */\n});\n```\n\n## Examples\n\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples).\n\nTo generate the examples from protos, please run `./generate.sh`\n\n## Gotchas\n\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.8.1-pre.9c8f487","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-Lu+rSGxySkjWQEug4Yr6+dN0sXliIQxgE0W2oRNmJCqEVKbBB6gJUfFs/ql2nQwOA46NbJQtbAX6sX2taNwjgw==","shasum":"6f81674311cc6e36f5e3224877b103ba0a466878","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.8.1-pre.9c8f487.tgz","fileCount":75,"unpackedSize":268029,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcOiLtCRA9TVsSAnZWagAAaL4P/AiNzWWXscKGyI01wgCG\nW+XzJ7wyjQkjdU9WjuzS4QQzyXSgGNVIN+JvDdNuTV7iMPoVZUbeiOSuY/XD\nGWNpbU7A5BtLCEIRn+Pynkx3ppM/gO6W9l1Uoducn2HPcFmZy3NAE9NnJLgu\nIYBZwZH1JIKiLY9d0CUhEoDwqPEzql/OflfC8ik7/x3q4/Imc5XjupLgEVp1\n7+azV0p3v2GoQYb4jthe4V+5xbyrkS+0gdY9Sv3qxykKNmWlTp/FlgyGwBrP\nzVIi7ZNw1pLPKrIXvlGgdy+FptYm1OFIXGeNuAbnY/eY13LNImBg8n9E8HwH\nIz/vXM7XsYD9cmJ3ZWgrpvUdh2X2/D9DLCh1qy9cF1cWc2jPjklltb2Zcyke\n+dUzrVLtqYvOF+01edCUMAhmdhvn2WGSEjmjjeclZMDV7N+G+EAulgnRYhO4\nGUsgVUVvTQ5YWeBMTaVpYUzVP4atqsRFEQkponR6QnUspR+4c/Czls3bu+nM\nBRk2GZEsLnuZxInlrz+hmZarsQC5TtLzVWEmFgn0Zme/qxgDwxbVSIDu6Ojj\nTfHzp0Xpk3A435m+kXKX4wlDGVxuWXjMEHJ9UkBPM0HGvpDrgkjd4owvhC2c\ne6f8gr+MSndc5fg7Bar0nUCrfBB8WRDFGrZ1WOAZrDQ0GRA7Fpzk1Y3Nwj91\n341f\r\n=LUYC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZ21UybTMVliO5jM0qWs7dRED68udQVnNX/XX4XqihkQIgZk/H72lftbRAW3XTr6apZxm9Jp+xHNZ6bulVbXztF28="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.8.1-pre.9c8f487_1547313900777_0.6386548036922763"},"_hasShrinkwrap":false},"0.9.0":{"name":"ts-protoc-gen","version":"0.9.0","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{},"devDependencies":{"@bazel/karma":"0.21.0","@bazel/typescript":"0.21.0","@improbable-eng/grpc-web":"^0.8.0","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/jasmine":"^2.8.9","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","google-protobuf":"^3.6.1","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"6d6f58092e15980bd2a88316836da741ce7619cc","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.9.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-cFEUTY9U9o6C4DPPfMHk2ZUdIAKL91hZN1fyx5Stz3g56BDVOC7hk+r5fEMCAGaaIgi2akkT1a2hrxu1wo2Phg==","shasum":"3910a67dc4445acf4bc3c6f7f67709619e987a6e","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.9.0.tgz","fileCount":75,"unpackedSize":268017,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcOiRjCRA9TVsSAnZWagAAb+4QAIcx9y7fpawtaeGpGYFL\noRnYIKLfHncT97gMCUGyWUoLhORWmUCulrMHuvLUPDmUdsLZD8ADBAKNDLgL\nL1K++bCAPzbHfZXRxJP2KK0yigv87us4aW0Qk5Edhqw5Kw8ALsLtbvNbkgQZ\n36xZefuVbBi+A48Co3VyWiyAja6M/1ZFUEpNLcHelTtbuzXV4qrefLOvyTeb\nI4Zkp2pfNLXEIAZoTaeV9y30ll8MJxNpFXtOWuXV53NY1l0QRv2lEWk432Gu\nSCMP/BAjAh3RVw2NTZc1Xiv6EowcZXuaKI7H5pv4hXNG2+v4c5GYtesQx87T\nfPchdSjfK78OxHtZJM/yPuUrtJSSnXmPPqC17yz5SpdNWV+EDpJQSLUkALml\n2yj7qSWAYkA2KjRCuDMyLEpc/tzJXT6PwsHHz45vdNLRjzkr/zttEmtSBTcz\njAOI/nkXjJ4wQM4hOXckoQp7KGgXccu5dx4jls4U8ZoiN0vhU2R6Vq4MfZlF\nL/m47kyCnwgfSVi1/jJCM7OQCmWuej4oomrzwKJjjJe1XD8xLK4yf102ugbb\nvxka0FK6TPPUKXIKiP/JV5BmeIfeVbBcIFrLxG8tAqtTd7GD0huLOLhJz5nH\ncU9dQ17FNAKHaOwDqnQWsmiMOMUY2Ew2eqHHbX4B3RkEirSwj5ZMdq8Obc+7\nH1v6\r\n=7tVp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBABv0sFrrzWCIunwGB32RWIGawARfHsfa6HycBcU02rAiEAr4hDvYBWzDW5OO2qC3VO0O/KsGd2LjszwjRfVcHn630="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.9.0_1547314275162_0.12124534382358765"},"_hasShrinkwrap":false},"0.9.1-pre.50abb56":{"name":"ts-protoc-gen","version":"0.9.1-pre.50abb56","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{},"devDependencies":{"@bazel/karma":"0.21.0","@bazel/typescript":"0.21.0","@improbable-eng/grpc-web":"^0.8.0","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/jasmine":"^2.8.9","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","google-protobuf":"^3.6.1","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"dbe373a578c184a2302f638e51699266fe3f19c1","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations\n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\n\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build/>bazel\">bazel</a> build environment</summary><p>\n\nInclude the following in your `WORKSPACE` - _Most of this setup is for\n[rules_typescript](https://github.com/bazelbuild/rules_typescript), see their instructions for more\ninfo:_\n\n```python\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n\nhttp_archive(\n    name = \"build_bazel_rules_typescript\",\n    sha256 = \"e4f51c408ed3278a3a1dd227564a69f293ae2ac4ae1564b3a6d2637ae9447b47\",\n    strip_prefix = \"rules_typescript-0.21.0\",\n    urls = [\"https://github.com/bazelbuild/rules_typescript/archive/0.21.0.zip\"],\n)\n\nhttp_archive(\n    name = \"ts_protoc_gen\",\n    # NOTE: Update these values to the latest version\n    sha256 = \"355bd8e7a3d4889a3fb222366ac3427229acc968455670378f8ffe1b4bfc5a95\",\n    strip_prefix = \"ts-protoc-gen-14d69f6203c291f15017a8c0abbb1d4b52b00b64\",\n    urls = [\"https://github.com/improbable-eng/ts-protoc-gen/archive/14d69f6203c291f15017a8c0abbb1d4b52b00b64.zip\"],\n)\n\nload(\"@build_bazel_rules_typescript//:package.bzl\", \"rules_typescript_dependencies\")\n\nrules_typescript_dependencies()\n\nload(\"@build_bazel_rules_typescript//:defs.bzl\", \"ts_setup_workspace\")\n\nts_setup_workspace()\n\nload(\"@build_bazel_rules_nodejs//:defs.bzl\", \"node_repositories\", \"yarn_install\")\n\nnode_repositories()\n\nyarn_install(\n    name = \"npm\",\n    package_json = \"//:package.json\",\n    yarn_lock = \"//:yarn.lock\",\n)\n\nload(\"@io_bazel_rules_go//go:def.bzl\", \"go_register_toolchains\", \"go_rules_dependencies\")\n\ngo_rules_dependencies()\n\ngo_register_toolchains()\n\nload(\"@io_bazel_rules_webtesting//web:repositories.bzl\", \"browser_repositories\", \"web_test_repositories\")\n\nweb_test_repositories()\n\nbrowser_repositories(\n    chromium = True,\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\n\ntypescript_proto_dependencies()\n```\n\nAlso make sure you have the following in your `package.json`:\n\n```json\n{\n  \"dependencies\": {\n    \"google-protobuf\": \"^3.6.1\",\n    \"@improbable-eng/grpc-web\": \"0.8.0\",\n    \"browser-headers\": \"^0.4.1\"\n  },\n  \"devDependencies\": {\n    \"@bazel/karma\": \"^0.21.0\",\n    \"@bazel/typescript\": \"^0.21.0\",\n    \"@types/google-protobuf\": \"^3.2.7\",\n    \"typescript\": \"^3.1.1\"\n  }\n}\n```\n\n> Run `yarn install` to generate the `yarn.lock` file.\n\nFinally, in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nproto_library(\n  name = \"test_proto\",\n  srcs = [\n    \"test.proto\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"test_ts_proto\",\n  proto = \":test_proto\",\n)\n```\n\nYou can use the `test_ts_proto` as a `dep` in other `ts_library` targets. However, you will need to\ninclude `google-protobuf`, `@improbable-eng/grpc-web`, and `browser-headers` at runtime yourself. See\n`//test/bazel:pizza_service_proto_test_suite` for an example.\n\n</p></details>\n\n## Contributing\n\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\n\nAs mentioned above, this plugin for `protoc` serves two purposes:\n\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\n\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport {\n  UserServiceClient,\n  GetUserRequest\n} from \"../generated/users_pb_service\";\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => {\n  /* ... */\n});\n```\n\n## Examples\n\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples).\n\nTo generate the examples from protos, please run `./generate.sh`\n\n## Gotchas\n\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.9.1-pre.50abb56","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-SqyGOFqJgRtBIpEKQO32yd2JCR87trjs30iX971jb7uoPUS5pDvb1j3v6zv7uRlKJQFwBGFjZi9qPpVtBntphA==","shasum":"9831cbbc915d92201a1a002ac2f331d25dcaca1a","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.9.1-pre.50abb56.tgz","fileCount":75,"unpackedSize":268043,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcOiToCRA9TVsSAnZWagAA66gP/R0qCftX4xoA6FujNFb8\ntfZHJKbYg9VHiKkUuI6tp9QSKrId30YkZ98HZSQdz9MJUWcAHVnnSvngWhjO\nE582c8xbMOdVJGKNkatnXTVIXNKUBR+tXhJbnu8B9qDQo4V9LnzktYYqV/zd\nS3rrDOldyknFBkiQPiCYcn/UpFpP/lNk4pI7nNvDkYtqJGetWC9UQRjrwALa\nPw+7x3Fzv1jokr4upeb1Q6RqyGJoVxCvUew+AdGpT4mh9SNEw8yA093tJmux\n4jB3XXz0bByr4troZuuAy7U4gpQcnl4GTNnnpaqayllnQscGaxNcY4HxqlKG\ni/ySAPb8RyWfMUo1saaFpScg0AjVASxhY43OZF1dR2huf+TvJn0sKG4VwV3H\nAdxX5UE8YGYZt/O/VbQ9G+dsBZRa6LztRqY4HHb9y92hk6A2T1bsv46AIz2U\nM4tBMftOdD4tcVBe4cOUH8om59SNkjkzGVP4B9hp9LfTtOKrVnFSuzCEo7oz\nKoMYbZ8K4B6Q2RYaF70cpYIa6mCj+6POhTFInp5I0mkMhd0tSQ+lP3bIELSf\nvlzHsPCfOiPed9E2KxnX5aBLQ/1Uk2YSeBfGhbpMqCdqO86bGS5xTV/wwkCI\n60ny3vtGHhjjxkL3lTE0DFLlU30q1BW+doESgK+Dn4VlFwt4JE39gWQdRkbO\np6eb\r\n=bw1F\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCQ8bnKYjB1oPgeqkDBNM05kwfHttJUu0cyeYTde05p/wIgaqT70EdzCNIjDuK+OTq4j0jd3EPqrbGjN1Ny5LYvvd8="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.9.1-pre.50abb56_1547314408247_0.2782942721030548"},"_hasShrinkwrap":false},"0.9.1-pre.7f532e5":{"name":"ts-protoc-gen","version":"0.9.1-pre.7f532e5","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{},"devDependencies":{"@bazel/karma":"0.21.0","@bazel/typescript":"0.21.0","@improbable-eng/grpc-web":"^0.8.0","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/jasmine":"^2.8.9","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","google-protobuf":"^3.6.1","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"1934805952a2ec8b1361d81d0245d9f5ad6ef1f9","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations\n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\n\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build\">bazel</a> build environment</summary><p>\n\nInclude the following in your `WORKSPACE` - _Most of this setup is for\n[rules_typescript](https://github.com/bazelbuild/rules_typescript), see their instructions for more\ninfo:_\n\n```python\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n\nhttp_archive(\n    name = \"build_bazel_rules_typescript\",\n    sha256 = \"e4f51c408ed3278a3a1dd227564a69f293ae2ac4ae1564b3a6d2637ae9447b47\",\n    strip_prefix = \"rules_typescript-0.21.0\",\n    urls = [\"https://github.com/bazelbuild/rules_typescript/archive/0.21.0.zip\"],\n)\n\nhttp_archive(\n    name = \"ts_protoc_gen\",\n    # NOTE: Update these values to the latest version\n    sha256 = \"355bd8e7a3d4889a3fb222366ac3427229acc968455670378f8ffe1b4bfc5a95\",\n    strip_prefix = \"ts-protoc-gen-14d69f6203c291f15017a8c0abbb1d4b52b00b64\",\n    urls = [\"https://github.com/improbable-eng/ts-protoc-gen/archive/14d69f6203c291f15017a8c0abbb1d4b52b00b64.zip\"],\n)\n\nload(\"@build_bazel_rules_typescript//:package.bzl\", \"rules_typescript_dependencies\")\n\nrules_typescript_dependencies()\n\nload(\"@build_bazel_rules_typescript//:defs.bzl\", \"ts_setup_workspace\")\n\nts_setup_workspace()\n\nload(\"@build_bazel_rules_nodejs//:defs.bzl\", \"node_repositories\", \"yarn_install\")\n\nnode_repositories()\n\nyarn_install(\n    name = \"npm\",\n    package_json = \"//:package.json\",\n    yarn_lock = \"//:yarn.lock\",\n)\n\nload(\"@io_bazel_rules_go//go:def.bzl\", \"go_register_toolchains\", \"go_rules_dependencies\")\n\ngo_rules_dependencies()\n\ngo_register_toolchains()\n\nload(\"@io_bazel_rules_webtesting//web:repositories.bzl\", \"browser_repositories\", \"web_test_repositories\")\n\nweb_test_repositories()\n\nbrowser_repositories(\n    chromium = True,\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\n\ntypescript_proto_dependencies()\n```\n\nAlso make sure you have the following in your `package.json`:\n\n```json\n{\n  \"dependencies\": {\n    \"google-protobuf\": \"^3.6.1\",\n    \"@improbable-eng/grpc-web\": \"0.8.0\",\n    \"browser-headers\": \"^0.4.1\"\n  },\n  \"devDependencies\": {\n    \"@bazel/karma\": \"^0.21.0\",\n    \"@bazel/typescript\": \"^0.21.0\",\n    \"@types/google-protobuf\": \"^3.2.7\",\n    \"typescript\": \"^3.1.1\"\n  }\n}\n```\n\n> Run `yarn install` to generate the `yarn.lock` file.\n\nFinally, in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nproto_library(\n  name = \"test_proto\",\n  srcs = [\n    \"test.proto\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"test_ts_proto\",\n  proto = \":test_proto\",\n)\n```\n\nYou can use the `test_ts_proto` as a `dep` in other `ts_library` targets. However, you will need to\ninclude `google-protobuf`, `@improbable-eng/grpc-web`, and `browser-headers` at runtime yourself. See\n`//test/bazel:pizza_service_proto_test_suite` for an example.\n\n</p></details>\n\n## Contributing\n\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\n\nAs mentioned above, this plugin for `protoc` serves two purposes:\n\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\n\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport {\n  UserServiceClient,\n  GetUserRequest\n} from \"../generated/users_pb_service\";\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => {\n  /* ... */\n});\n```\n\n## Examples\n\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples).\n\nTo generate the examples from protos, please run `./generate.sh`\n\n## Gotchas\n\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.9.1-pre.7f532e5","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-NPpMK51Ky8kd1P7ss1JqLt5vHSJthut7Mk5zRc+N58qYr1x2a5rvWTw8Blma0yZ2eHXgb30AP2V0VjcYX3MWsQ==","shasum":"331b385f73bbda4b2b830b8731f682903a262cc3","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.9.1-pre.7f532e5.tgz","fileCount":75,"unpackedSize":268036,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcnxcnCRA9TVsSAnZWagAAkN8P/3KKCPVDExc2TKTCuMTr\nlvoHuFqFGJAN+KzMXl1VRrA2UXAu4WKNdgOKFc+Ll4BerlOT2tTNOqF+CnMs\n+4tP/kafloRtqZ6ufr8c/QY13gbbFItST7meGZxiPQeQXj57JWVm3tZ0QteQ\n5VrR6Uz3WL8iipe7SygacD7EaUfVCTpfWS2nyeabCJxLzFxrIKO862A5n+o0\nzwqz2mJSDv9rItoHtigSXNsfeczlbaZN1JJoHGJu3fXyeWbSQANXAKqlQd4H\nDy+97tTFGgVHH6wVaF8wBjQ+b22zG/bndy3hN5EU1rupTWLTpX/CzNRReTKY\nxCHkMSJRrAQZxQc0gxehr0ASmaluBhuhb5nPjW0BkUVKvRkffb+hpt4ZjjXf\nCPnfjhMADVok22bQPJ8l1VuckTdezM7cvZjq9D2SJo+pA7T8MIOpl/UlTb5a\nL8Md/z+8eLi/KQ2qeUnpOnsbYmOOY+Aal0Ii3BLTGB6+75gn6Aii9A56rpyQ\n0C2IW8cvI/C1Qc3GT0BMG6gfTxI7isGuHN2t5vq87FHDrmJo8iSYUlVCpnk5\nuLPAjktizlWKrTIXYsu+qo83oWoqiTQATn8R0XoV4QqrGzxyDrCge73FIU7h\n05saCI/HMU54IVkH5KALLYOirM+NmILbdtuU+1JtwgSEBjHjfXaJdEQ6bHAi\n3uyy\r\n=86HA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFSh9Cur3czY0m+84VA1HrDozJh6hDO3gSwfZRNPBYHMAiEAsNqFaf0WWK5JiR7fwnM19K9wavZLOqKB6S4XiyIWils="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.9.1-pre.7f532e5_1553930023185_0.5094565987668798"},"_hasShrinkwrap":false},"0.9.1-pre.c8a573d":{"name":"ts-protoc-gen","version":"0.9.1-pre.c8a573d","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{},"devDependencies":{"@bazel/karma":"0.21.0","@bazel/typescript":"0.21.0","@improbable-eng/grpc-web":"^0.8.0","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/jasmine":"^2.8.9","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","google-protobuf":"^3.6.1","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"dc60bb105e06f80533f3618412a4d6bec9d454b6","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations\n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\n\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build\">bazel</a> build environment</summary><p>\n\nInclude the following in your `WORKSPACE` - _Most of this setup is for\n[rules_typescript](https://github.com/bazelbuild/rules_typescript), see their instructions for more\ninfo:_\n\n```python\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n\nhttp_archive(\n    name = \"build_bazel_rules_typescript\",\n    sha256 = \"e4f51c408ed3278a3a1dd227564a69f293ae2ac4ae1564b3a6d2637ae9447b47\",\n    strip_prefix = \"rules_typescript-0.21.0\",\n    urls = [\"https://github.com/bazelbuild/rules_typescript/archive/0.21.0.zip\"],\n)\n\nhttp_archive(\n    name = \"ts_protoc_gen\",\n    # NOTE: Update these values to the latest version\n    sha256 = \"355bd8e7a3d4889a3fb222366ac3427229acc968455670378f8ffe1b4bfc5a95\",\n    strip_prefix = \"ts-protoc-gen-14d69f6203c291f15017a8c0abbb1d4b52b00b64\",\n    urls = [\"https://github.com/improbable-eng/ts-protoc-gen/archive/14d69f6203c291f15017a8c0abbb1d4b52b00b64.zip\"],\n)\n\nload(\"@build_bazel_rules_typescript//:package.bzl\", \"rules_typescript_dependencies\")\n\nrules_typescript_dependencies()\n\nload(\"@build_bazel_rules_typescript//:defs.bzl\", \"ts_setup_workspace\")\n\nts_setup_workspace()\n\nload(\"@build_bazel_rules_nodejs//:defs.bzl\", \"node_repositories\", \"yarn_install\")\n\nnode_repositories()\n\nyarn_install(\n    name = \"npm\",\n    package_json = \"//:package.json\",\n    yarn_lock = \"//:yarn.lock\",\n)\n\nload(\"@io_bazel_rules_go//go:def.bzl\", \"go_register_toolchains\", \"go_rules_dependencies\")\n\ngo_rules_dependencies()\n\ngo_register_toolchains()\n\nload(\"@io_bazel_rules_webtesting//web:repositories.bzl\", \"browser_repositories\", \"web_test_repositories\")\n\nweb_test_repositories()\n\nbrowser_repositories(\n    chromium = True,\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\n\ntypescript_proto_dependencies()\n```\n\nAlso make sure you have the following in your `package.json`:\n\n```json\n{\n  \"dependencies\": {\n    \"google-protobuf\": \"^3.6.1\",\n    \"@improbable-eng/grpc-web\": \"0.8.0\",\n    \"browser-headers\": \"^0.4.1\"\n  },\n  \"devDependencies\": {\n    \"@bazel/karma\": \"^0.21.0\",\n    \"@bazel/typescript\": \"^0.21.0\",\n    \"@types/google-protobuf\": \"^3.2.7\",\n    \"typescript\": \"^3.1.1\"\n  }\n}\n```\n\n> Run `yarn install` to generate the `yarn.lock` file.\n\nFinally, in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nproto_library(\n  name = \"test_proto\",\n  srcs = [\n    \"test.proto\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"test_ts_proto\",\n  proto = \":test_proto\",\n)\n```\n\nYou can use the `test_ts_proto` as a `dep` in other `ts_library` targets. However, you will need to\ninclude `google-protobuf`, `@improbable-eng/grpc-web`, and `browser-headers` at runtime yourself. See\n`//test/bazel:pizza_service_proto_test_suite` for an example.\n\n</p></details>\n\n## Contributing\n\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\n\nAs mentioned above, this plugin for `protoc` serves two purposes:\n\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\n\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport {\n  UserServiceClient,\n  GetUserRequest\n} from \"../generated/users_pb_service\";\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => {\n  /* ... */\n});\n```\n\n## Examples\n\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples).\n\nTo generate the examples from protos, please run `./generate.sh`\n\n## Gotchas\n\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.9.1-pre.c8a573d","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-hXRDjHYchYYXyJf6es7wesur73HiWIx6dbErYll78m9y6rZWCPE0Xo4/Jl0SZzDkBKsVPcXA+82WVMPukdPg5Q==","shasum":"1af84b6287ed7cd55268538a30b01241473d4784","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.9.1-pre.c8a573d.tgz","fileCount":75,"unpackedSize":268267,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJco6sVCRA9TVsSAnZWagAAu/8P/jz6bJNA1YnT2+K+gJvG\nraSxgYRGy+9gRpRhf2OcQXyo5dZYN6u/3ivvsOZL8FbIfsrJEqwdMzxdeRl6\nKKPckettp2SITAGXHw77SMGUCo6FDGqDNkevK8M0ucYqZhnxJ76YwfWC/xi5\nL3iqSThC5+l+XqkzKRHCJl3s8/+U4YHW5k1KTAIN9f9XNWr7qpbjeu6fp7dS\nIM7GyQ2A2MbNo5hKrU4E4laUjcNql6dJIwBy5AjQkMSI8Zw/6703HSwSG6+Y\nczylQtt7Ht9Wy+AwY7IKfKpi21iEio6wSyF6EFqKumi/ntaNzO2cvas//+i+\nJrZJVs7+7+ugAK2ILofdLhtt4pnjwyz1BQ375cb1U55Lf3TYLid0hRWr1tQi\nqj5mIdElYJoMtR+AienWaM4fyq0CFaOTO3jVwDdbFBflwXhuFhva+JfIXtoB\n3sPB2lTP5uuKioy81lTnZ108PvkADHHgrLXexZQu9Vxa88F+FphLvhRMYIWX\nFR4bR6meDE5VDfkdMN23W7/dSncvNemGK0Usitfie6Rs4oCaZBbNEu+Nh6LY\n4Q+d6s9Va3KoQUpqzJncfWdN7ryBRAtbmU25BbmN8yWtTGW1pxYE32MV8kwU\ntA8pGd36158mgqNUcU5lj31ETpvG2bY2Cq2P4AEhGnxJe3FlLUeizOP/9lOV\nk2mh\r\n=70R1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCcfZnHS0FDqfqAHMQNPaULPAdUHyVfjt7yJDSccn4SoQIgThAwJLiopLlBU4q92jcaRIBYvJrXs8BJaSe0OuBNUD4="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.9.1-pre.c8a573d_1554230037071_0.30178521438132155"},"_hasShrinkwrap":false},"0.9.1-pre.901b08e":{"name":"ts-protoc-gen","version":"0.9.1-pre.901b08e","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{},"devDependencies":{"@bazel/karma":"0.21.0","@bazel/typescript":"0.21.0","@improbable-eng/grpc-web":"^0.8.0","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/jasmine":"^2.8.9","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","google-protobuf":"^3.6.1","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"51a364d08aff8ff5282bbf3f97ea09c6b879d1b5","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations\n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\n\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build\">bazel</a> build environment</summary><p>\n\nInclude the following in your `WORKSPACE` - _Most of this setup is for\n[rules_typescript](https://github.com/bazelbuild/rules_typescript), see their instructions for more\ninfo:_\n\n```python\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n\nhttp_archive(\n    name = \"build_bazel_rules_typescript\",\n    sha256 = \"e4f51c408ed3278a3a1dd227564a69f293ae2ac4ae1564b3a6d2637ae9447b47\",\n    strip_prefix = \"rules_typescript-0.21.0\",\n    urls = [\"https://github.com/bazelbuild/rules_typescript/archive/0.21.0.zip\"],\n)\n\nhttp_archive(\n    name = \"ts_protoc_gen\",\n    # NOTE: Update these values to the latest version\n    sha256 = \"355bd8e7a3d4889a3fb222366ac3427229acc968455670378f8ffe1b4bfc5a95\",\n    strip_prefix = \"ts-protoc-gen-14d69f6203c291f15017a8c0abbb1d4b52b00b64\",\n    urls = [\"https://github.com/improbable-eng/ts-protoc-gen/archive/14d69f6203c291f15017a8c0abbb1d4b52b00b64.zip\"],\n)\n\nload(\"@build_bazel_rules_typescript//:package.bzl\", \"rules_typescript_dependencies\")\n\nrules_typescript_dependencies()\n\nload(\"@build_bazel_rules_typescript//:defs.bzl\", \"ts_setup_workspace\")\n\nts_setup_workspace()\n\nload(\"@build_bazel_rules_nodejs//:defs.bzl\", \"node_repositories\", \"yarn_install\")\n\nnode_repositories()\n\nyarn_install(\n    name = \"npm\",\n    package_json = \"//:package.json\",\n    yarn_lock = \"//:yarn.lock\",\n)\n\nload(\"@io_bazel_rules_go//go:def.bzl\", \"go_register_toolchains\", \"go_rules_dependencies\")\n\ngo_rules_dependencies()\n\ngo_register_toolchains()\n\nload(\"@io_bazel_rules_webtesting//web:repositories.bzl\", \"browser_repositories\", \"web_test_repositories\")\n\nweb_test_repositories()\n\nbrowser_repositories(\n    chromium = True,\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\n\ntypescript_proto_dependencies()\n```\n\nAlso make sure you have the following in your `package.json`:\n\n```json\n{\n  \"dependencies\": {\n    \"google-protobuf\": \"^3.6.1\",\n    \"@improbable-eng/grpc-web\": \"0.8.0\",\n    \"browser-headers\": \"^0.4.1\"\n  },\n  \"devDependencies\": {\n    \"@bazel/karma\": \"^0.21.0\",\n    \"@bazel/typescript\": \"^0.21.0\",\n    \"@types/google-protobuf\": \"^3.2.7\",\n    \"typescript\": \"^3.1.1\"\n  }\n}\n```\n\n> Run `yarn install` to generate the `yarn.lock` file.\n\nFinally, in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nproto_library(\n  name = \"test_proto\",\n  srcs = [\n    \"test.proto\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"test_ts_proto\",\n  proto = \":test_proto\",\n)\n```\n\nYou can use the `test_ts_proto` as a `dep` in other `ts_library` targets. However, you will need to\ninclude `google-protobuf`, `@improbable-eng/grpc-web`, and `browser-headers` at runtime yourself. See\n`//test/bazel:pizza_service_proto_test_suite` for an example.\n\n</p></details>\n\n## Contributing\n\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\n\nAs mentioned above, this plugin for `protoc` serves two purposes:\n\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\n\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport {\n  UserServiceClient,\n  GetUserRequest\n} from \"../generated/users_pb_service\";\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => {\n  /* ... */\n});\n```\n\n## Examples\n\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples).\n\nTo generate the examples from protos, please run `./generate.sh`\n\n## Gotchas\n\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.9.1-pre.901b08e","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-ClBPiCtFk61N9NkXhwttqWpAuCo9gK4lYz53NBDGjL19yyf+ojMztaMX389zxkFGS51OEbl4haCznS7ODdJpWQ==","shasum":"e8260953dfa00c46ae2a1b7db527a33e376d2ef2","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.9.1-pre.901b08e.tgz","fileCount":75,"unpackedSize":268977,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcpKJ2CRA9TVsSAnZWagAAfz4QAJ3k/f6ERXvcN5Yisxa2\nFz+ne9l4DL9XJV/+4KzeYcAdXg4qOwXZ72naZWkJywg55d/TkZyKx1GeUUR7\nG6QG6/6JfkCTvBTPOIEtC+cR+25tnKckNJ+/SlYUxMdJs8iLJexSWAEVwnsT\nD4V+xcXaCryPIIKGsKp1054IpgrbpOzH6Uc6yUeoXbt1aBhIcHrtLrDO8aN4\nbYeDuMNUlAMuhvj+b0cmKBLXcuiJY/pbSIPAeuUFWfkXUk9SmARBUamdLT8T\nXEfR5XP5EjR+X9Q8VvyT1NypzoCj6B1cTu2oBPS+tmQMWilfwosLROGe3QPH\nWGhS0nnwkFlwBMwVpjT7ZCjSIisSPOxGl72VI78SpTzBNxOiHzh/uL8MseOt\nMGPZY7/XUjaFu94oo3y1NNGOFfMAcdn2CJXbOVENkoKegYHBIj0/w7yTfUlS\nXT3ZNUDojV/9DtjeYBfXdLs1KL3r8URYVL+myxmHpv7NKrM14zgdPmkjwLoX\nFYAXEBLh4NiB2V0Yg3EOJYXh9KrQh3StYtB3dkjQL6dFyWawn7QcGHiqGwt9\nEvDLAVxibRMx3DJtNbPOT64lQKu+AIUFyvWvBNqq0QkpBmeT3olW36XKVdrO\ng21pgia9hAlzYlQw7F5nHen3nhd4BIMn1TWFW1o0Cqw8LjEd1IDPBph8PXVy\njDWK\r\n=n3U1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCNFMrvqSQjU4yzh3r0SVnQfC7pUbD6T10uG3lqnnu0bwIhAPBCGHcHwCBDe05Jl+cnT+Z0FXNnqZLOj7zG3NLfEdW3"}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.9.1-pre.901b08e_1554293365523_0.028886994859576687"},"_hasShrinkwrap":false},"0.9.1-pre.aa468e9":{"name":"ts-protoc-gen","version":"0.9.1-pre.aa468e9","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{},"devDependencies":{"@bazel/karma":"0.27.8","@bazel/typescript":"^0.27.7","@improbable-eng/grpc-web":"^0.9.1","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/jasmine":"^2.8.9","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","google-protobuf":"^3.6.1","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"31718193b4cee9baf22f21b5762609c370d7338a","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations\n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\n\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build\">bazel</a> build environment</summary><p>\n\nPrerequisites:\n- Setup [rules_nodejs](https://github.com/bazelbuild/rules_nodejs) in your project\n\nThen, include the following in your `WORKSPACE`:\n\n```python\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n\n# NOTE: Setup rules_nodejs\n\nhttp_archive(\n    name = \"ts_protoc_gen\",\n    # NOTE: Update these values to the latest version\n    sha256 = \"355bd8e7a3d4889a3fb222366ac3427229acc968455670378f8ffe1b4bfc5a95\",\n    strip_prefix = \"ts-protoc-gen-14d69f6203c291f15017a8c0abbb1d4b52b00b64\",\n    urls = [\"https://github.com/improbable-eng/ts-protoc-gen/archive/14d69f6203c291f15017a8c0abbb1d4b52b00b64.zip\"],\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\n\ntypescript_proto_dependencies()\n```\n\nAlso make sure you have the following in your `package.json`:\n\n```json\n{\n  \"dependencies\": {\n    \"google-protobuf\": \"^3.6.1\",\n    \"@improbable-eng/grpc-web\": \"0.8.0\",\n    \"browser-headers\": \"^0.4.1\"\n  },\n  \"devDependencies\": {\n    \"@bazel/karma\": \"0.27.8\",\n    \"@bazel/typescript\": \"^0.27.7\",\n    \"@types/google-protobuf\": \"^3.2.7\",\n    \"typescript\": \"^3.1.1\"\n  }\n}\n```\n\n> Run `yarn install` to generate the `yarn.lock` file.\n\nFinally, in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nproto_library(\n  name = \"test_proto\",\n  srcs = [\n    \"test.proto\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"test_ts_proto\",\n  proto = \":test_proto\",\n)\n```\n\nYou can use the `test_ts_proto` as a `dep` in other `ts_library` targets. However, you will need to\ninclude `google-protobuf`, `@improbable-eng/grpc-web`, and `browser-headers` at runtime yourself. See\n`//test/bazel:pizza_service_proto_test_suite` for an example.\n\n</p></details>\n\n## Contributing\n\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\n\nAs mentioned above, this plugin for `protoc` serves two purposes:\n\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\n\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport {\n  UserServiceClient,\n  GetUserRequest\n} from \"../generated/users_pb_service\";\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => {\n  /* ... */\n});\n```\n\n## Examples\n\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples).\n\nTo generate the examples from protos, please run `./generate.sh`\n\n## Gotchas\n\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.9.1-pre.aa468e9","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-bY2aCBEAukr4PDDlZq8Add+YZsYh42sqWjRPK92U0f6I5T7YZwR3nwMTQrahzIo2VvrGpqHZLGhyB7JmUAmqpA==","shasum":"b1f681c4ac4adb2d577aca1add7d7709c2a2826e","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.9.1-pre.aa468e9.tgz","fileCount":75,"unpackedSize":228638,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcpa6MCRA9TVsSAnZWagAAyrYP/1R3kW1HoOVsMEuHXx8/\nqFS7zOonYCmMr1eBl9nuz+QkV3CWfcd7W5hhRK2+rNbrm5YJrqdHzsGPi4Mv\n7B4/oDAf5KazgNAvUPMSsWCawDxEI6fyUkAoy7H4nMDGes35QzxijXAwph/C\nzkjoUsuSd8xqUXwHpz2albuwBkNxMvacAaffLlDjP7UVXfhXslnRy7uve/uw\nMZZHFz8MviiuHnF3sLlChNOG3PIzO+qRZ+JBXl8PPybJJV9hzzVpYQ21BVAZ\ngTn7e9oJePzIQyppcwtxNHZiI+F7vFCxV7sgU9DhEl2t1hApX1fEa3MHXw9t\n4BfpC3qOXGsu3GqFKesmBZ4EFBR3xdjOSTOTaQtcMbQYNtHi6uuQsIHp6lXv\nvld3EKjz07jMvhZzxfpsoKpK9niaG7xREpPgOtNkqtds30pdRra/lRlIbV2n\nqMaPI4rokO7nQeZ8D5O2et8XPUb1Am9qPPxMTkoCbkgb7wc4mkvSdPfC4N9k\n8I5MJGC2FECNl0PFTv/W6tZ9+CbJHncenWIVGV/EUcGeYUkdAPyJmO+QSARm\nRPLeG4HlIJ7FBxW8QZpsIUDwT5LXEuTIS8A8bx5x8HGn4422ILfsmak/1ah+\nmrDCeaDwAPPcMqXCP9BkAVeQJ3h0nob0IwBW+TKbqw1mXCeb14f6UbffWupS\nOcmo\r\n=JdL/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD48fdhH2M8aSISessK5zTno3BxGQGeChOtOmgCXsqblgIgfbmJEk6k3QffVZ+dKHy9BuLBskNEik+ho42Hst+RVEo="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.9.1-pre.aa468e9_1554361996174_0.5755343719881574"},"_hasShrinkwrap":false},"0.9.1-pre.63a2845":{"name":"ts-protoc-gen","version":"0.9.1-pre.63a2845","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@bazel/karma":"0.27.8","@bazel/typescript":"^0.27.7","@improbable-eng/grpc-web":"^0.9.1","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/jasmine":"^2.8.9","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"f1ad0ffa842bd6ba2486bd5c3131ec3df1484881","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations\n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\n\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build\">bazel</a> build environment</summary><p>\n\nPrerequisites:\n- Setup [rules_nodejs](https://github.com/bazelbuild/rules_nodejs) in your project\n\nThen, include the following in your `WORKSPACE`:\n\n```python\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n\n# NOTE: Setup rules_nodejs\n\nhttp_archive(\n    name = \"ts_protoc_gen\",\n    # NOTE: Update these values to the latest version\n    sha256 = \"355bd8e7a3d4889a3fb222366ac3427229acc968455670378f8ffe1b4bfc5a95\",\n    strip_prefix = \"ts-protoc-gen-14d69f6203c291f15017a8c0abbb1d4b52b00b64\",\n    urls = [\"https://github.com/improbable-eng/ts-protoc-gen/archive/14d69f6203c291f15017a8c0abbb1d4b52b00b64.zip\"],\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\n\ntypescript_proto_dependencies()\n```\n\nAlso make sure you have the following in your `package.json`:\n\n```json\n{\n  \"dependencies\": {\n    \"google-protobuf\": \"^3.6.1\",\n    \"@improbable-eng/grpc-web\": \"0.8.0\",\n    \"browser-headers\": \"^0.4.1\"\n  },\n  \"devDependencies\": {\n    \"@bazel/karma\": \"0.27.8\",\n    \"@bazel/typescript\": \"^0.27.7\",\n    \"@types/google-protobuf\": \"^3.2.7\",\n    \"typescript\": \"^3.1.1\"\n  }\n}\n```\n\n> Run `yarn install` to generate the `yarn.lock` file.\n\nFinally, in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nproto_library(\n  name = \"test_proto\",\n  srcs = [\n    \"test.proto\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"test_ts_proto\",\n  proto = \":test_proto\",\n)\n```\n\nYou can use the `test_ts_proto` as a `dep` in other `ts_library` targets. However, you will need to\ninclude `google-protobuf`, `@improbable-eng/grpc-web`, and `browser-headers` at runtime yourself. See\n`//test/bazel:pizza_service_proto_test_suite` for an example.\n\n</p></details>\n\n## Contributing\n\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\n\nAs mentioned above, this plugin for `protoc` serves two purposes:\n\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\n\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport {\n  UserServiceClient,\n  GetUserRequest\n} from \"../generated/users_pb_service\";\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => {\n  /* ... */\n});\n```\n\n## Examples\n\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples).\n\nTo generate the examples from protos, please run `./generate.sh`\n\n## Gotchas\n\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.9.1-pre.63a2845","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-gC+OKkPHYoogRwgge9dKRv2ZD9hvuDhr4WLlIom1FxzfPFrnQK/IPFWOb5gfqLmyVDOJDjUMWO0Ei32mWsV4AA==","shasum":"22304faeff8990299a6e7f8fb0ca005599bdbec7","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.9.1-pre.63a2845.tgz","fileCount":75,"unpackedSize":228640,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcpdv5CRA9TVsSAnZWagAAZg0P/2XQxDlA5za/r+rGnTzm\nLZNtqzOLzC6lkAMo59gnyc/lrBwtqx42fQfCsf0PdjxkkH/AobLtTAPknWz7\nPKlTwnXBgshdqmh9bGXYupp6A87dTXn/qfOBUs07v/rMIf1bkIQ6l1vW6oa3\n2VzeAW8cQzj5y0tyqawskoY0hxcWU/70XV3OkdoPgWymZmp5qXCBz6hGwbxa\nK1gIhFKg3Y8GnK9bpqy1dyqzovZlube1csbi+9z0W3WjyLN3KOwF7j7WT5hr\nqYs37u6xdcTnab4Uvv4m1OYt9wNEe/TcSXxXo2KnXz5a/2MttT7+qtU4CQY2\nm4M8UfHwA+QL9wTh4vkXBmldzcgoKFdZA0xVbVhT5s0YrJ696f9yBNd9AC7i\nKmmiIdSR1/l5eEL9VxI857eY5k9yCXowxDA+3XYB/wvgayWf/nbXhUh5Ath5\nNGLcXtErP+OCq2M0+3uA+ddkIMh5QirH5q2TTU2FYQcsnoPPNDhAcIkTELsT\nDWojL3iT+qdNULu2YWydEDSGp3chI+G0T+F7MAjCCuiUviAvN61GKRjoQtVX\n3QVM8lKcGZDQpepI5dKexCXkrW35yK4bvnd0uHZ5OnTBdLdkgJF8ltUDqblu\nfwJ3HmlMAT/oYPmwiL28VRrCdqLPIWQRUpD+nLFrk68rqvfS4Dmmr3VAgBYW\nad0i\r\n=Xqai\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCPHiBWMvrbRVcfNqthSrtpDYruD67zcLUvpq/Tixbe7QIhAOiAdoybI+Z/vGKlZsC5zchdrbgnUh8gY/des2oqlHc/"}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.9.1-pre.63a2845_1554373625121_0.15039845149788422"},"_hasShrinkwrap":false},"0.9.1-pre.cdb79ec":{"name":"ts-protoc-gen","version":"0.9.1-pre.cdb79ec","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@bazel/karma":"0.27.8","@bazel/typescript":"^0.27.7","@improbable-eng/grpc-web":"^0.9.1","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/jasmine":"^2.8.9","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"87d67153ce63a1d7996c12efdbcf40ad1b30673f","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations\n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\n\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build\">bazel</a> build environment</summary><p>\n\nPrerequisites:\n- Setup [rules_nodejs](https://github.com/bazelbuild/rules_nodejs) in your project\n\nThen, include the following in your `WORKSPACE`:\n\n```python\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n\n# NOTE: Setup rules_nodejs\n\nhttp_archive(\n    name = \"ts_protoc_gen\",\n    # NOTE: Update these values to the latest version\n    sha256 = \"355bd8e7a3d4889a3fb222366ac3427229acc968455670378f8ffe1b4bfc5a95\",\n    strip_prefix = \"ts-protoc-gen-14d69f6203c291f15017a8c0abbb1d4b52b00b64\",\n    urls = [\"https://github.com/improbable-eng/ts-protoc-gen/archive/14d69f6203c291f15017a8c0abbb1d4b52b00b64.zip\"],\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\n\ntypescript_proto_dependencies()\n```\n\nAlso make sure you have the following in your `package.json`:\n\n```json\n{\n  \"dependencies\": {\n    \"google-protobuf\": \"^3.6.1\",\n    \"@improbable-eng/grpc-web\": \"0.8.0\",\n    \"browser-headers\": \"^0.4.1\"\n  },\n  \"devDependencies\": {\n    \"@bazel/karma\": \"0.27.8\",\n    \"@bazel/typescript\": \"^0.27.7\",\n    \"@types/google-protobuf\": \"^3.2.7\",\n    \"typescript\": \"^3.1.1\"\n  }\n}\n```\n\n> Run `yarn install` to generate the `yarn.lock` file.\n\nFinally, in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nproto_library(\n  name = \"test_proto\",\n  srcs = [\n    \"test.proto\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"test_ts_proto\",\n  proto = \":test_proto\",\n)\n```\n\nYou can use the `test_ts_proto` as a `dep` in other `ts_library` targets. However, you will need to\ninclude `google-protobuf`, `@improbable-eng/grpc-web`, and `browser-headers` at runtime yourself. See\n`//test/bazel:pizza_service_proto_test_suite` for an example.\n\n</p></details>\n\n## Contributing\n\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\n\nAs mentioned above, this plugin for `protoc` serves two purposes:\n\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\n\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport {\n  UserServiceClient,\n  GetUserRequest\n} from \"../generated/users_pb_service\";\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => {\n  /* ... */\n});\n```\n\n## Examples\n\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples).\n\nTo generate the examples from protos, please run `./generate.sh`\n\n## Gotchas\n\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.9.1-pre.cdb79ec","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-+ZZwp39acC3Sd70seCKW4/qSOuQEJB0gcN3RtLVEh9HwSEWkkvE7Zf7mHACumj+/8aKRN0Fy+u5Bd+EeK2n8ow==","shasum":"6a8d5df66dd7d0080c2f07da020cb73d1bbdf90f","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.9.1-pre.cdb79ec.tgz","fileCount":75,"unpackedSize":228646,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcri9iCRA9TVsSAnZWagAA73wP/3lNbnOg2BTvDfYw3/ZC\nEtObIcLBerLltDJdOAhExux2rtaf2SQkBaotyea1wxqYd117SiluV6WldRg+\nit5LLn57MV9IKb/MCFV/d4byW1cjxbtTfTHaocAapKh5ITScqo8Jw85wfelO\nhRdggRLuUC97r2ZPz4wVDW1fcQjNYvcnhtojmBjcaIMR80Z3QZ1+KcTJSKW5\nnsjn2bwTjVt6WiTs1cbzPEjI+MWWw9eGnu4sVdtqXRPgp7zQSDONfyZHvKZx\nUd96GJ2uXlMRIyQb+8DLq3yCoz87FWRJyUdv5O1BmRIa7GHXEQNTVJTK2s71\nsgoLviNB1xeue35leWshYs2Pg9s3ZtXRQtor6NxlTc1C4S/Bs+WmpPHfe772\nP7o36GnD9N75o2WcMJncrViFhW/le+zsUN08TlHzXP6pHPR6b4x8hhzV2DbF\ni+DSQQzbewRwGkNeb5GMx2VILsWbKPTxdzZEGoWrZQrZ6mei/Zwgfy0KGHiX\nxJXTGTQesPf1t9AiFexe5hZ6Urw/kce8Pt0pjHby+d+9/WuJb3iC4ALwVXQG\nORmFs4KG4ggbi+NaKTZZAlbsSLLl3Dg1NZkpy1P50vug3sO8t0nEsRG/aU73\nxJxQKIm8B9ah5+BPlJfB2mCF0HwtHqpzdf7ZOKUcG9jM9K7qaxmFPQnbbAox\nNVv1\r\n=ODwX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHoN/KnODuSlIqLSVTLIlAdChEBaIbCWOKkpl5A/IF54AiEAn7CMtgsqkHJSkYYbY5BAAkCCa9c/VbKeQ3c0XnuCJ04="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.9.1-pre.cdb79ec_1554919265999_0.489619981739561"},"_hasShrinkwrap":false},"0.9.1-pre.cbe7398":{"name":"ts-protoc-gen","version":"0.9.1-pre.cbe7398","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@bazel/karma":"0.27.8","@bazel/typescript":"^0.27.7","@improbable-eng/grpc-web":"^0.9.1","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/jasmine":"^2.8.9","@types/lodash":"^4.14.106","@types/minimist":"^1.2.0","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","minimist":"^1.2.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"e6f46a1a0ab9ab3f253d16968f0b9a3e8ef1c4dd","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations\n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\n\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build\">bazel</a> build environment</summary><p>\n\nPrerequisites:\n- Setup [rules_nodejs](https://github.com/bazelbuild/rules_nodejs) in your project\n\nThen, include the following in your `WORKSPACE`:\n\n```python\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n\n# NOTE: Setup rules_nodejs\n\nhttp_archive(\n    name = \"ts_protoc_gen\",\n    # NOTE: Update these values to the latest version\n    sha256 = \"355bd8e7a3d4889a3fb222366ac3427229acc968455670378f8ffe1b4bfc5a95\",\n    strip_prefix = \"ts-protoc-gen-14d69f6203c291f15017a8c0abbb1d4b52b00b64\",\n    urls = [\"https://github.com/improbable-eng/ts-protoc-gen/archive/14d69f6203c291f15017a8c0abbb1d4b52b00b64.zip\"],\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\n\ntypescript_proto_dependencies()\n```\n\nAlso make sure you have the following in your `package.json`:\n\n```json\n{\n  \"dependencies\": {\n    \"google-protobuf\": \"^3.6.1\",\n    \"@improbable-eng/grpc-web\": \"0.8.0\",\n    \"browser-headers\": \"^0.4.1\"\n  },\n  \"devDependencies\": {\n    \"@bazel/karma\": \"0.27.8\",\n    \"@bazel/typescript\": \"^0.27.7\",\n    \"@types/google-protobuf\": \"^3.2.7\",\n    \"typescript\": \"^3.1.1\"\n  }\n}\n```\n\n> Run `yarn install` to generate the `yarn.lock` file.\n\nFinally, in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nproto_library(\n  name = \"test_proto\",\n  srcs = [\n    \"test.proto\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"test_ts_proto\",\n  proto = \":test_proto\",\n)\n```\n\nYou can use the `test_ts_proto` as a `dep` in other `ts_library` targets. However, you will need to\ninclude `google-protobuf`, `@improbable-eng/grpc-web`, and `browser-headers` at runtime yourself. See\n`//test/bazel:pizza_service_proto_test_suite` for an example.\n\n</p></details>\n\n## Contributing\n\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\n\nAs mentioned above, this plugin for `protoc` serves two purposes:\n\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\n\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport {\n  UserServiceClient,\n  GetUserRequest\n} from \"../generated/users_pb_service\";\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => {\n  /* ... */\n});\n```\n\n## Examples\n\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples).\n\nTo generate the examples from protos, please run `./generate.sh`\n\n## Gotchas\n\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.9.1-pre.cbe7398","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-tl+xO/JF9cJS6KD9ACKGK/mRl66jQH5tzATtqvGKYzaIIkF5h4AdC9fqEVKlf2sWNH1Q6yvLn6J5DI6RGw4NVw==","shasum":"615ad703ebd6ddbe319bcfc8735a9674144b2512","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.9.1-pre.cbe7398.tgz","fileCount":78,"unpackedSize":231583,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcsjKpCRA9TVsSAnZWagAAbdAP/1lY02r8u7G0HBY3h0fr\nm2f3B4axNioUBVagBmlA6YYdbB5OjsVMBJjkKJBgzuhpir4wp5mU642V3qTo\nLQTjiGmk5mzVaB3sZKaw9ctUfCOq4UX8EUfWVh1tyIQiF44IgtRTHO4pUbVN\nK3QSJIH6ndt62HKMD9sSZm3oc7Kty4rrbQK+xoqk9Iqdhsg8RZviHwbQg9Ev\nEqLa6tVx7qlSYpHKvJicxHG/wtcmyMWZ5UeazwcsZ6KqUXBoaaG9DRQ0QC89\nrsugXQLuYMTmA6EeDKmmdocD4Yr5+1KZwfPKFcsaZ9BGtPZuJKYS2GlGFce8\n8HUxounITMkRnE30OfRxho5mRpR5eKnhyBLcDHtNIOl5sGXj3wTbLENR2QV8\ns/jdeLQctK6U69nwucQBs0x6yRja0QMsRjKQEy7QaYN2y4S+ShGZCp0Jepia\nj74QugIj8K9khEnn/FpwgVZ/tDcNCtjOyVoDvuKovT0fdTkNLa7nCWwi4PB1\n7mT7HdRTSTpU7spEwQI1ljox8j0Uez0hEL/rj9F6jWf1xogjYHDHBpv+V+rP\nZtiw32ofUTATdxZrpNvYDlIp3Q/clzV/TJKhW1J0ZOV82AMbWbZ2XBwYvMv0\n89t3PEZX2MqcnYQ8KRFOpTGygKRrrYzzoCsGdTweHoR0BVuLnM/Sve9iCrFP\n/FrU\r\n=NGQh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCzuy0CaFb6WeY1RqSt/v6EUNWjM35a79VbyqtRJcV9YAIgOd12x5Qr/b7xFoIvLKk7Hd7O8hlwKM8arr994KZkRY0="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.9.1-pre.cbe7398_1555182248889_0.37168692123407276"},"_hasShrinkwrap":false},"0.9.1-pre.ad36364":{"name":"ts-protoc-gen","version":"0.9.1-pre.ad36364","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@bazel/karma":"0.27.8","@bazel/typescript":"^0.27.7","@improbable-eng/grpc-web":"^0.9.1","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/jasmine":"^2.8.9","@types/lodash":"^4.14.106","@types/minimist":"^1.2.0","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","minimist":"^1.2.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"b6a48770ba09d063f39040e8d04ec6450d043a88","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations\n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\n\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build\">bazel</a> build environment</summary><p>\n\nPrerequisites:\n- Setup [rules_nodejs](https://github.com/bazelbuild/rules_nodejs) in your project\n\nThen, include the following in your `WORKSPACE`:\n\n```python\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n\n# NOTE: Setup rules_nodejs\n\nhttp_archive(\n    name = \"ts_protoc_gen\",\n    # NOTE: Update these values to the latest version\n    sha256 = \"355bd8e7a3d4889a3fb222366ac3427229acc968455670378f8ffe1b4bfc5a95\",\n    strip_prefix = \"ts-protoc-gen-14d69f6203c291f15017a8c0abbb1d4b52b00b64\",\n    urls = [\"https://github.com/improbable-eng/ts-protoc-gen/archive/14d69f6203c291f15017a8c0abbb1d4b52b00b64.zip\"],\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\n\ntypescript_proto_dependencies()\n```\n\nAlso make sure you have the following in your `package.json`:\n\n```json\n{\n  \"dependencies\": {\n    \"google-protobuf\": \"^3.6.1\",\n    \"@improbable-eng/grpc-web\": \"0.8.0\",\n    \"browser-headers\": \"^0.4.1\"\n  },\n  \"devDependencies\": {\n    \"@bazel/karma\": \"0.27.8\",\n    \"@bazel/typescript\": \"^0.27.7\",\n    \"@types/google-protobuf\": \"^3.2.7\",\n    \"typescript\": \"^3.1.1\"\n  }\n}\n```\n\n> Run `yarn install` to generate the `yarn.lock` file.\n\nFinally, in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nproto_library(\n  name = \"test_proto\",\n  srcs = [\n    \"test.proto\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"test_ts_proto\",\n  proto = \":test_proto\",\n)\n```\n\nYou can use the `test_ts_proto` as a `dep` in other `ts_library` targets. However, you will need to\ninclude `google-protobuf`, `@improbable-eng/grpc-web`, and `browser-headers` at runtime yourself. See\n`//test/bazel:pizza_service_proto_test_suite` for an example.\n\n</p></details>\n\n## Contributing\n\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\n\nAs mentioned above, this plugin for `protoc` serves two purposes:\n\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\n\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport {\n  UserServiceClient,\n  GetUserRequest\n} from \"../generated/users_pb_service\";\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => {\n  /* ... */\n});\n```\n\n## Examples\n\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples).\n\nTo generate the examples from protos, please run `./generate.sh`\n\n## Gotchas\n\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.9.1-pre.ad36364","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-MQq8PuBtD3eHt6l2R6kTe+Mw0bGDBzPZWKWXKaQbLsJTR0tFWsz8QrSMUoWqsE09gzH8IRnrfSjkwsd3jjHbow==","shasum":"f8881ea108f62c02ec2173e3fac632599ff77631","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.9.1-pre.ad36364.tgz","fileCount":78,"unpackedSize":232424,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc29SeCRA9TVsSAnZWagAAT/cQAJzn4T1R7sc8ejIFbDVl\nJhMck6i6ia8y/1c0z505+PgE8Qe+ueObvqDLI/3NCmjBwfSqox6/UBwXtqsV\nV6SGm2RS6ZnszzZrU2vCabKSSBA7gEASjD8JpX/se0LSwjqtvsVRIrhrsAAR\nna1CJSqttkSPbGQZzyAbgADN/Ll8lopmwWIZys36hLPWev5ATFZ3s3q1eh07\n/VF7rFqRrmpVridmmgU811t9Bbwifmuj0P2T6CNXHI/k/RMzETMx90SDRnPl\nczRJMskkwKb/OtFP7LeR/gJnvbKaBxiQMFABE3P5bfeU4+ZU5ykvLp4qLc6q\nfJSajvaDXFy+e8QE1Y85rF+uSsnJ1elUlzk66MVveQtHRfpR5pgWvv79g94d\n0FTnSnEp/M9+M/8Ini+cNnotEwXa7QDrbbD+n2umzjITXj3lJJcNlYpqQYk4\nl5snVRUkABRYG/X9AnpT8yWk/FdwSodiuj6r68tAw4HFylS7P+AesP85PSwG\noyEzzqDWFCbqXqNVIzO3+Y81tobgm2CwiiyP5jHkhIo/0cX4azrkU9FhqH7V\nmpNgvqHJK/ratwPmOcFfHyv7JjEjuzNjo3FBXIOq3xT8zONww4+GTdCHhimh\nZgi2UDnKdJER0jAWGXfZFt1SzeZR0GpfOP1sCPJq7USI++fNy0M2/rAnTCBO\nXQNA\r\n=/EkP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCiFu5wCYI6YaBWacHU6d5OtheutXE7RCNZjTG1Q7MYuAIhAImEq3hVCAGNdk68UyTpbtKE63cfiGBkwXRYbvnkdyMN"}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.9.1-pre.ad36364_1557910685758_0.6506606846972758"},"_hasShrinkwrap":false},"0.10.0":{"name":"ts-protoc-gen","version":"0.10.0","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@bazel/karma":"0.27.8","@bazel/typescript":"^0.27.7","@improbable-eng/grpc-web":"^0.9.1","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/jasmine":"^2.8.9","@types/lodash":"^4.14.106","@types/minimist":"^1.2.0","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","minimist":"^1.2.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"9574497b5de7ad3dc03378b37bffb8ff571a7754","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.10.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-EEbgDWNHK3CvcNhmib94I4HMO23qLddjLRdXW8EUE11VJxbi3n5J0l2DiX/L1pijOaPTkbEoRK+zQinKgKGqsw==","shasum":"f708d99be59ad0be6bdce6f4fe893ec41757d2c9","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.10.0.tgz","fileCount":78,"unpackedSize":232413,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc29YHCRA9TVsSAnZWagAA68cQAJbVrQYWX0eMkjQ8FuO+\nYqdF/1ceNV5cwWfg1GRWpAVtF9kvGAB3eu61Z8IcxyDVcZ9ETbfNoRPd3v0/\nNAtxT4HKYYqNijHYBeY6TBpAXJB7kmAQVAKtjKqDoHDNhrS2Hd8kcYpVaCZd\no99tA+oYo+wFyiGwIq4SpRQEHeS0icGiASBRkzu+lcxmbz++6WmY3zOGt+76\nyCHze7mEzRg4m68YBHSIGoI0S0ENTRoWTplh71IcRWQcvJxohl/MeodAFzzI\nIvy9CQii+HS4heV3OClcdIHrwLYv4rGIVeLRlEILVKXsGf39JISLbN5pZ5Lo\nWyI8trEQpXb7vmQhUbrRu7QlMHHrFf0fYUADPKtEJwLpYFqBvct0WTs9W4z2\nr2VjH7dUELBrjDjEbsQpSoc8Al6OFxN1k6VcHldueRIPwPawWiycoXFP8pCa\neldr13TrUP+9TO1IKyQTT0TYH+iwpQqotR7c3V8q5N2AX9yfR+OOEXzh8vp5\nFgjxLnMjgXK6/e2ImeUssLQ1YsM3VZTU5P6aHZVkJFQpuLokinbpativ4wpK\nxQOAcy4+9h1RmLbOpsIUGAv4Fj5xj/Vjr9A07beu+U/YWfmVRHjT0Lwctzw4\nw2g585GHWbc5SW2ZCIaGr04Y+j9iO1TX+cLhmqe5Oczi7ePPaVBSNa+NzPnk\nIp18\r\n=eUEo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDYiI/MKbG47vC0fH8v93PwfiAOIW2OW72l+Kxcr7yk7AiEAv7s8fOUp6tmNj0/BncnRNHOqK6SSkc2JWVao+SzVKa8="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.10.0_1557911047039_0.32934730493445863"},"_hasShrinkwrap":false},"0.10.1-pre.e8c15bc":{"name":"ts-protoc-gen","version":"0.10.1-pre.e8c15bc","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@bazel/karma":"0.27.8","@bazel/typescript":"^0.27.7","@improbable-eng/grpc-web":"^0.9.1","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/jasmine":"^2.8.9","@types/lodash":"^4.14.106","@types/minimist":"^1.2.0","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","minimist":"^1.2.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"e834ff21cc5d57ba1864c842e81bf060adabccd5","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations\n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\n\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build\">bazel</a> build environment</summary><p>\n\nPrerequisites:\n- Setup [rules_nodejs](https://github.com/bazelbuild/rules_nodejs) in your project\n\nThen, include the following in your `WORKSPACE`:\n\n```python\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n\n# NOTE: Setup rules_nodejs\n\nhttp_archive(\n    name = \"ts_protoc_gen\",\n    # NOTE: Update these values to the latest version\n    sha256 = \"355bd8e7a3d4889a3fb222366ac3427229acc968455670378f8ffe1b4bfc5a95\",\n    strip_prefix = \"ts-protoc-gen-14d69f6203c291f15017a8c0abbb1d4b52b00b64\",\n    urls = [\"https://github.com/improbable-eng/ts-protoc-gen/archive/14d69f6203c291f15017a8c0abbb1d4b52b00b64.zip\"],\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\n\ntypescript_proto_dependencies()\n```\n\nAlso make sure you have the following in your `package.json`:\n\n```json\n{\n  \"dependencies\": {\n    \"google-protobuf\": \"^3.6.1\",\n    \"@improbable-eng/grpc-web\": \"0.8.0\",\n    \"browser-headers\": \"^0.4.1\"\n  },\n  \"devDependencies\": {\n    \"@bazel/karma\": \"0.27.8\",\n    \"@bazel/typescript\": \"^0.27.7\",\n    \"@types/google-protobuf\": \"^3.2.7\",\n    \"typescript\": \"^3.1.1\"\n  }\n}\n```\n\n> Run `yarn install` to generate the `yarn.lock` file.\n\nFinally, in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nproto_library(\n  name = \"test_proto\",\n  srcs = [\n    \"test.proto\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"test_ts_proto\",\n  proto = \":test_proto\",\n)\n```\n\nYou can use the `test_ts_proto` as a `dep` in other `ts_library` targets. However, you will need to\ninclude `google-protobuf`, `@improbable-eng/grpc-web`, and `browser-headers` at runtime yourself. See\n`//test/bazel:pizza_service_proto_test_suite` for an example.\n\n</p></details>\n\n## Contributing\n\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\n\nAs mentioned above, this plugin for `protoc` serves two purposes:\n\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\n\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport {\n  UserServiceClient,\n  GetUserRequest\n} from \"../generated/users_pb_service\";\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => {\n  /* ... */\n});\n```\n\n## Examples\n\nFor a sample of the generated protos and service definitions, see [examples](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples).\n\nTo generate the examples from protos, please run `./generate.sh`\n\n## Gotchas\n\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.10.1-pre.e8c15bc","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-J6Tf1a0OxPKu08QXwcJp6F2UhmZ8oZP1LPMvAm5DZWXL0pSdwPe81RKa1WuO5QnNN3LeZU+qAooDz21CVGwTEQ==","shasum":"48b603bceb63cb98c621afdabd3dcf5670ad360d","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.10.1-pre.e8c15bc.tgz","fileCount":78,"unpackedSize":232440,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc29lCCRA9TVsSAnZWagAAQR8P/RhXe7dvErGuQe4IPcda\nI0C44q0FM+cAZmqJ+vmayO61CB22FG7IkDNClgvo8e8n1M4Jdnw7g3t6DL03\nrHXyqA0N2wVNvQU5iRaRM7Ltq5QzUouP+VYYsl1q6hdSunyuXs0x33p028aO\nyEVOEowdlWcLz8ImBZpLVEymSNkb2cB4EcWdRo/Yo59MR4VFxgGNftccgJdC\nrdsp9yofrLdQ5TgBhAbv+1H+mF1D/LE4+Jh4j+V1XcgnSnp9+qskk2SG+AlE\n83aAhBaOGPbEPzm+A9P8CjzCPhM2cV2DvZDn9ytGwkGscIcORyYdmMAZY3V1\n6mEjXJAk6xFcmsz9Jo7CCh9KrWgnTvuWXVLZEM+O7vLjgGrOhOH2g8gxysLC\nQJ4ycU4V8hhLzA47c2WhDSDZNSdKkDPYFBohpVhjB6faL/KCodTS7sZMo6AB\nD7iG1j7PcPkUJ7YZQpQNBL4vVlcOeqAWBy/+G5Cy7Yf7kAMhGo2YCyk3UQtD\nd5XUtIgLP/tRb60eju8M53++ttvAD4gzoTboqCCrXPpDY1hKOD868kjVmzzR\nn/XfhEhTSYNnAS644SjgXO8nIdmhXfAAHR2AjZaRwEc6XSqOjGW+qTH9RCbs\n7KljCmbZEXDycaIYF5KWWvL/2Ew6nElx+snpWzTOdz2hWq+AlX87bFeTYDfL\ncLfh\r\n=VaX2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAT+4cVrklbdvxw/4uCqYzeaSDpG35Oob5ocG7SwOJatAiBjeT/T4+9E7sBU2iYy9JjHnkQ55Bx75N/A7+hTG77+hQ=="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.10.1-pre.e8c15bc_1557911873851_0.7773369783137016"},"_hasShrinkwrap":false},"0.10.1-pre.6d22676":{"name":"ts-protoc-gen","version":"0.10.1-pre.6d22676","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@bazel/karma":"0.27.8","@bazel/typescript":"^0.27.7","@improbable-eng/grpc-web":"^0.9.1","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/jasmine":"^2.8.9","@types/lodash":"^4.14.106","@types/minimist":"^1.2.0","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","minimist":"^1.2.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"a5e64319c92a1e72c678277f5a804ddee29ff717","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations\n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\n\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build\">bazel</a> build environment</summary><p>\n\nPrerequisites:\n- Setup [rules_nodejs](https://github.com/bazelbuild/rules_nodejs) in your project\n\nThen, include the following in your `WORKSPACE`:\n\n```python\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n\n# NOTE: Setup rules_nodejs\n\nhttp_archive(\n    name = \"ts_protoc_gen\",\n    # NOTE: Update these values to the latest version\n    sha256 = \"355bd8e7a3d4889a3fb222366ac3427229acc968455670378f8ffe1b4bfc5a95\",\n    strip_prefix = \"ts-protoc-gen-14d69f6203c291f15017a8c0abbb1d4b52b00b64\",\n    urls = [\"https://github.com/improbable-eng/ts-protoc-gen/archive/14d69f6203c291f15017a8c0abbb1d4b52b00b64.zip\"],\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\n\ntypescript_proto_dependencies()\n```\n\nAlso make sure you have the following in your `package.json`:\n\n```json\n{\n  \"dependencies\": {\n    \"google-protobuf\": \"^3.6.1\",\n    \"@improbable-eng/grpc-web\": \"0.8.0\",\n    \"browser-headers\": \"^0.4.1\"\n  },\n  \"devDependencies\": {\n    \"@bazel/karma\": \"0.27.8\",\n    \"@bazel/typescript\": \"^0.27.7\",\n    \"@types/google-protobuf\": \"^3.2.7\",\n    \"typescript\": \"^3.1.1\"\n  }\n}\n```\n\n> Run `yarn install` to generate the `yarn.lock` file.\n\nFinally, in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nproto_library(\n  name = \"test_proto\",\n  srcs = [\n    \"test.proto\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"test_ts_proto\",\n  proto = \":test_proto\",\n)\n```\n\nYou can use the `test_ts_proto` as a `dep` in other `ts_library` targets. However, you will need to\ninclude `google-protobuf`, `@improbable-eng/grpc-web`, and `browser-headers` at runtime yourself. See\n`//test/bazel:pizza_service_proto_test_suite` for an example.\n\n</p></details>\n\n## Contributing\n\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\n\nAs mentioned above, this plugin for `protoc` serves two purposes:\n\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\n\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport {\n  UserServiceClient,\n  GetUserRequest\n} from \"../generated/users_pb_service\";\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => {\n  /* ... */\n});\n```\n\n## Examples\n\n- [Example output]((https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples)) -- Code generated by `ts-protoc-gen`.\n- [Packaging the output as a node module](https://github.com/improbable-eng/ts-protoc-gen/issues/173) -- Example of how to use the generated code as a dependendecy of another module.\n\n## Gotchas\n\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.10.1-pre.6d22676","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-iOtjd9Z9UIppJeBT93Eba6xcEEMWpV4gycpMq3C7P/SM5xzxIbKMSlp8vS78nldsytDt6FKKLL/+kth1OISwVg==","shasum":"0036287dbd92b31ddb6d12de54fb3b2b796781f9","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.10.1-pre.6d22676.tgz","fileCount":78,"unpackedSize":232538,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc2+CLCRA9TVsSAnZWagAAEnwP/A+KnXPzfIPzImfT8Uoi\nPMrUHnbh/+s+OqYgXI5Nx3mAKsK3tECilSz1NaYK2w+u7VpYZXockXvjp760\no+4gsJTufFGt/9cHcLl5yMeNpBOy+C43IOMXYlvGoSNdudOcSnchf3eg9Mqq\nbEcGo9CRvLlsDU4VOzgZBS/ZKr4DHA7jUX+GOKx45mVkes3OhdRjoCohZM70\nY8DvgMzpotDYrb5D91cAh0jFjTAe8/DIM5QC8iiQspgChRDED8xWH646gEmS\naKIRgkF6YGjEpBXElUmtgZOSqY+4aKXI20469yaBufeS8DTI7pjhYb+X7sGj\n8uT4FK0oEevscLB4AaVnUNvqiR041nL9eepsw1VYIQH1yyHVpdQy4LIp3Ga4\nnK5AMDmvMQmxeWlBCQ9CsltTXawG2+4QRdNLejmcYDuljf1H+GQ/M6C6AqAD\nfA1Zjq0t6OOjDVuBBsElMnk9UCZ10j4gAGprtnjyIatY2yYyFPI73c8dHlH2\nK1nlkDjEICp7dFiL+Hm5JHX6zMZFlF4/dGrQEWss+1H1152AvSWlXZEg/l8E\n6Scx9AaBQm1Z7y52ZZoR+n74J4v8xucNT6dJfsrB60t05WGHKc4J3joVG0Z4\nQF9zlJl4R1anVjELY5gxDZzn/G77FHPKp0l4SQZAxKna4PEoMOq1QDshjFl8\nSbZz\r\n=/1vA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDrjdB4WTJhrrMii/C/Q1bKVZY/IKmNmaZKhwo3TKucuAIgdWYtI9Wt0HnTuROPvCpx/SOgzBKDx4qltLomPhMQOe0="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.10.1-pre.6d22676_1557913739155_0.7718314928398382"},"_hasShrinkwrap":false},"0.10.1-pre.78cf7ae":{"name":"ts-protoc-gen","version":"0.10.1-pre.78cf7ae","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@bazel/karma":"0.27.8","@bazel/typescript":"^0.27.7","@improbable-eng/grpc-web":"^0.9.1","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/jasmine":"^2.8.9","@types/lodash":"^4.14.106","@types/minimist":"^1.2.0","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","minimist":"^1.2.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"6c7ce658ac634b5b10bede2789e9fbad5080b3c0","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations\n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\n\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build\">bazel</a> build environment</summary><p>\n\nPrerequisites:\n- Setup [rules_nodejs](https://github.com/bazelbuild/rules_nodejs) in your project\n\nThen, include the following in your `WORKSPACE`:\n\n```python\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n\n# NOTE: Setup rules_nodejs\n\nhttp_archive(\n    name = \"ts_protoc_gen\",\n    # NOTE: Update these values to the latest version\n    sha256 = \"355bd8e7a3d4889a3fb222366ac3427229acc968455670378f8ffe1b4bfc5a95\",\n    strip_prefix = \"ts-protoc-gen-14d69f6203c291f15017a8c0abbb1d4b52b00b64\",\n    urls = [\"https://github.com/improbable-eng/ts-protoc-gen/archive/14d69f6203c291f15017a8c0abbb1d4b52b00b64.zip\"],\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\n\ntypescript_proto_dependencies()\n```\n\nAlso make sure you have the following in your `package.json`:\n\n```json\n{\n  \"dependencies\": {\n    \"google-protobuf\": \"^3.6.1\",\n    \"@improbable-eng/grpc-web\": \"0.8.0\",\n    \"browser-headers\": \"^0.4.1\"\n  },\n  \"devDependencies\": {\n    \"@bazel/karma\": \"0.27.8\",\n    \"@bazel/typescript\": \"^0.27.7\",\n    \"@types/google-protobuf\": \"^3.2.7\",\n    \"typescript\": \"^3.1.1\"\n  }\n}\n```\n\n> Run `yarn install` to generate the `yarn.lock` file.\n\nFinally, in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nproto_library(\n  name = \"test_proto\",\n  srcs = [\n    \"test.proto\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"test_ts_proto\",\n  proto = \":test_proto\",\n)\n```\n\nYou can use the `test_ts_proto` as a `dep` in other `ts_library` targets. However, you will need to\ninclude `google-protobuf`, `@improbable-eng/grpc-web`, and `browser-headers` at runtime yourself. See\n`//test/bazel:pizza_service_proto_test_suite` for an example.\n\n</p></details>\n\n## Contributing\n\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\n\nAs mentioned above, this plugin for `protoc` serves two purposes:\n\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\n\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport {\n  UserServiceClient,\n  GetUserRequest\n} from \"../generated/users_pb_service\";\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => {\n  /* ... */\n});\n```\n\n## Examples\n\n- [Example output](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples) -- Code generated by `ts-protoc-gen`.\n- [Packaging the output as a node module](https://github.com/improbable-eng/ts-protoc-gen/issues/173) -- Example of how to use the generated code as a dependendecy of another module.\n\n## Gotchas\n\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.10.1-pre.78cf7ae","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-YIR1K8zpT1KQiE57M4tbC7nByQuY/P1yAsZYHhxHviYfWxJmpNZ+9ir8PRWgt3Ra3bnzmkfYvLMtXZljbSOQOA==","shasum":"6ba03feff87bf486ee6cdce41558865f81ca4b8e","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.10.1-pre.78cf7ae.tgz","fileCount":78,"unpackedSize":232536,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc2+DTCRA9TVsSAnZWagAAhBgP/RWUuhh522soJ/xMIIiC\nBpi/1yZFElKtGPnigKFiub77CPJFYO/sJqnhP8+Cr34/5mUvyNLi61p96WG+\nOH4ije1r5Dz67Sn5y7pDnA4C+Eo+tGKMFF7pgKP8nBvvDLS61/vQUet8MKts\nHq+04l2oQHiSLyDt7XfhJ2RE0XKOZ8PO0KheXNYfGQy3X2uVjzV2zx9otZMx\nNan3jUssWrU3b/MHBd2q8HdbJ1IPD0OgQgpUMujQU9bMt8Dfk3wJ+/Whj861\nbKQEbhrE1YwDWkUJUOTcgWLO1+cqm3nL4bQ1NebGnoL8Xb4un09ApWmcnzzI\nZ8Uf/m3cTxn8n7upe7GQ9PDuQv45dCY7mhBl+e9C2s0sqUNl5qe3W8EFMaLa\nJ0spcH0PPbX4bs8gIZNit1jK3iWAINQeGTlaCn/zg9xElbd6ZgcRk8STh7ky\n1lwK3EVV4IRT298MYLyDMTzX8j41HzhfNa6XYDf9pJ+L8OU4sBCgSE63fF5Q\nhkepO6VMA62ikqBhNOveoPoGlmaG8MpKNEi/7NO0P3JWchEiVsSBGPf3MhWL\nCaHTPP/qr7aWiEK/Urr+Ii79/wHcN0mvvdNiik6W5yS5PqYM/rEo0TBGJQmI\nAWqeaN0hOZIhpoQmcl9fD0uFyZ7AUDEMUqGfbbwQtPdDAyNsbmS2NhIE1HPR\nmsrd\r\n=Y8yo\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCnTOfU21lDrE9WUy0eDS1H80aHJs567nVseBBL5KOkfwIhAI3nAHcMPZas1LbPo+HcE4A1lRn92oQzT6puzkUrNEEx"}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.10.1-pre.78cf7ae_1557913811071_0.5381440567677569"},"_hasShrinkwrap":false},"0.10.1-pre.987f176":{"name":"ts-protoc-gen","version":"0.10.1-pre.987f176","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@bazel/karma":"0.27.8","@bazel/typescript":"^0.27.7","@improbable-eng/grpc-web":"^0.9.1","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/jasmine":"^2.8.9","@types/lodash":"^4.14.106","@types/minimist":"^1.2.0","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","minimist":"^1.2.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"3c23109dca76a3b796fc290cc4b08df378044830","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations\n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\n\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build\">bazel</a> build environment</summary><p>\n\nPrerequisites:\n- Setup [rules_nodejs](https://github.com/bazelbuild/rules_nodejs) in your project\n\nThen, include the following in your `WORKSPACE`:\n\n```python\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n\n# NOTE: Setup rules_nodejs\n\nhttp_archive(\n    name = \"ts_protoc_gen\",\n    # NOTE: Update these values to the latest version\n    sha256 = \"355bd8e7a3d4889a3fb222366ac3427229acc968455670378f8ffe1b4bfc5a95\",\n    strip_prefix = \"ts-protoc-gen-14d69f6203c291f15017a8c0abbb1d4b52b00b64\",\n    urls = [\"https://github.com/improbable-eng/ts-protoc-gen/archive/14d69f6203c291f15017a8c0abbb1d4b52b00b64.zip\"],\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\n\ntypescript_proto_dependencies()\n```\n\nAlso make sure you have the following in your `package.json`:\n\n```json\n{\n  \"dependencies\": {\n    \"google-protobuf\": \"^3.6.1\",\n    \"@improbable-eng/grpc-web\": \"0.8.0\",\n    \"browser-headers\": \"^0.4.1\"\n  },\n  \"devDependencies\": {\n    \"@bazel/karma\": \"0.27.8\",\n    \"@bazel/typescript\": \"^0.27.7\",\n    \"@types/google-protobuf\": \"^3.2.7\",\n    \"typescript\": \"^3.1.1\"\n  }\n}\n```\n\n> Run `yarn install` to generate the `yarn.lock` file.\n\nFinally, in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nproto_library(\n  name = \"test_proto\",\n  srcs = [\n    \"test.proto\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"test_ts_proto\",\n  proto = \":test_proto\",\n)\n```\n\nYou can use the `test_ts_proto` as a `dep` in other `ts_library` targets. However, you will need to\ninclude `google-protobuf`, `@improbable-eng/grpc-web`, and `browser-headers` at runtime yourself. See\n`//test/bazel:pizza_service_proto_test_suite` for an example.\n\n#### IDE Code Completion\nIf you'd like to get code completion working for the generated protos in your IDE, add the following to your `tsconfig.json`:\n\n```\n{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"paths\": {\n      # Replace <workspace-name> with the name of your workspace\n      \"<workspace-name>/*\": [\n        \"*\", # Enables absolute paths for src files in your project\n        \"bazel-bin/*\" # Enables referencing generate protos with absolute paths\n      ]\n    }\n  }\n}\n```\n\n> NOTE: This has only been tested in IntelliJ with the bazel plugin\n\n</p></details>\n\n## Contributing\n\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\n\nAs mentioned above, this plugin for `protoc` serves two purposes:\n\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\n\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport {\n  UserServiceClient,\n  GetUserRequest\n} from \"../generated/users_pb_service\";\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => {\n  /* ... */\n});\n```\n\n## Examples\n\n- [Example output](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples) -- Code generated by `ts-protoc-gen`.\n- [Packaging the output as a node module](https://github.com/improbable-eng/ts-protoc-gen/issues/173) -- Example of how to use the generated code as a dependendecy of another module.\n\n## Gotchas\n\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.10.1-pre.987f176","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-fu/0caG5vj7a7DUGxyscPybfDRlw5VHWHHfChhlSP64P1nT0pmVBJsCVffMTOEvV0TbFlxGz8BXFj6Y3ezDyCQ==","shasum":"31553270c9c831b5bfb1e540832e74acf402a1b3","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.10.1-pre.987f176.tgz","fileCount":78,"unpackedSize":233089,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc2+H7CRA9TVsSAnZWagAAiNQP/Rbx1i7se4a7lyC9vSPO\nOsbk7u5YJASYoCXKV74q4cb/BLFrxjosPRz6dDiXNwWDzFQafWABP/kK58LW\ni02PIIDtkxEZ6ggOpmirYFod/BwvdlBGb7wqwBTqOIQf2s3GOALGOkyKJ6Io\nEGbf2Yft9OunwUCiBtTKEW/I2Af4hpHM8t/Kby108xcY5rJvbUkT9X65P+7N\noXxPsryZSUvolEXtM3Ov6jVMIBbeIsYH8OqlDqbaWnkoQ1o5cuxI5UJoZX7i\naSZUgHeJb66LyoaLE1wAtmC8Yrymogkqm0bpPwkvte58Sdp2UvW2tH1tPqEl\nXNp5/n3XJ8dopNTwk6xKvZS4WSEQZVJF9cr5uUi3a69PrhfJI4BP32NMrNWY\n5wuf0fviFRiLCsO/ZnSUbrlXo3FLDK2VH33PX7s6qWGQz0hkxOUI/mOpSdNh\nP8TfixhtvERAXuHAPAmN+3pz0A6pAx9b+EX21xy6gEmpRYlAiB77Ddx1B74u\np/aibW2lWbJdvIvP02ebiPm9f2LhW+aGAoV7jbzci8RmwTKKyiaZ/kS9xCar\nx3RtBA58BzBPwIyPyQw1RPHjvijFxqVY+eTXht9aaBAQUru9jPBvDorYtsSi\nCJsOjLtUAfXttiguIQK7THOUcoqIf8t2cWk1JgLZDSBorPSv+xC/JjlCgqYI\nMNXN\r\n=sWOG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB0Hyhi8VvJCN9mVDrTPuKf7mlHVGzvmSBiIqqjmE4i4AiEA3dA+KU44afn0/mveMve0kHvF0dwLVtqQ8jNzH6F/9dg="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.10.1-pre.987f176_1557914107045_0.5831195197716117"},"_hasShrinkwrap":false},"0.10.1-pre.cf38460":{"name":"ts-protoc-gen","version":"0.10.1-pre.cf38460","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@bazel/karma":"0.27.8","@bazel/typescript":"^0.27.7","@improbable-eng/grpc-web":"^0.9.1","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/jasmine":"^2.8.9","@types/lodash":"^4.14.106","@types/minimist":"^1.2.0","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","minimist":"^1.2.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"ed34f9b60be8a4db53ccf60a263610963a4b4333","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations\n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\n\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build\">bazel</a> build environment</summary><p>\n\nPrerequisites:\n- Setup [rules_nodejs](https://github.com/bazelbuild/rules_nodejs) in your project\n\nThen, include the following in your `WORKSPACE`:\n\n```python\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n\n# NOTE: Setup rules_nodejs\n\nhttp_archive(\n    name = \"ts_protoc_gen\",\n    # NOTE: Update these values to the latest version\n    sha256 = \"355bd8e7a3d4889a3fb222366ac3427229acc968455670378f8ffe1b4bfc5a95\",\n    strip_prefix = \"ts-protoc-gen-14d69f6203c291f15017a8c0abbb1d4b52b00b64\",\n    urls = [\"https://github.com/improbable-eng/ts-protoc-gen/archive/14d69f6203c291f15017a8c0abbb1d4b52b00b64.zip\"],\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\n\ntypescript_proto_dependencies()\n```\n\nAlso make sure you have the following in your `package.json`:\n\n```json\n{\n  \"dependencies\": {\n    \"google-protobuf\": \"^3.6.1\",\n    \"@improbable-eng/grpc-web\": \"0.8.0\",\n    \"browser-headers\": \"^0.4.1\"\n  },\n  \"devDependencies\": {\n    \"@bazel/karma\": \"0.27.8\",\n    \"@bazel/typescript\": \"^0.27.7\",\n    \"@types/google-protobuf\": \"^3.2.7\",\n    \"typescript\": \"^3.1.1\"\n  }\n}\n```\n\n> Run `yarn install` to generate the `yarn.lock` file.\n\nFinally, in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nproto_library(\n  name = \"test_proto\",\n  srcs = [\n    \"test.proto\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"test_ts_proto\",\n  proto = \":test_proto\",\n)\n```\n\nYou can use the `test_ts_proto` as a `dep` in other `ts_library` targets. However, you will need to\ninclude `google-protobuf`, `@improbable-eng/grpc-web`, and `browser-headers` at runtime yourself. See\n`//test/bazel:pizza_service_proto_test_suite` for an example.\n\n#### IDE Code Completion\nIf you'd like to get code completion working for the generated protos in your IDE, add the following to your `tsconfig.json`:\n\n```\n{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"paths\": {\n      # Replace <workspace-name> with the name of your workspace\n      \"<workspace-name>/*\": [\n        \"*\", # Enables absolute paths for src files in your project\n        \"bazel-bin/*\" # Enables referencing generate protos with absolute paths\n      ]\n    }\n  }\n}\n```\n\n> NOTE: This has only been tested in IntelliJ with the bazel plugin\n\n</p></details>\n\n## Contributing\n\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\n\nAs mentioned above, this plugin for `protoc` serves two purposes:\n\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\n\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport {\n  UserServiceClient,\n  GetUserRequest\n} from \"../generated/users_pb_service\";\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => {\n  /* ... */\n});\n```\n\n## Examples\n\n- [Example output](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples) -- Code generated by `ts-protoc-gen`.\n- [Packaging the output as a node module](https://github.com/improbable-eng/ts-protoc-gen/issues/173) -- Example of how to use the generated code as a dependendecy of another module.\n\n## Gotchas\n\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.10.1-pre.cf38460","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-6mIwQTiKbqDyDGWsUiD8IB4uVM8Equ14oRKxxjg/XVD1iGoyC6QjCusLtJ8g4XHsw06XzSykLww9xfvtg6j01A==","shasum":"5643967d3bf4ee3ec9da24d7ba0df6b978f4c162","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.10.1-pre.cf38460.tgz","fileCount":79,"unpackedSize":233842,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdAseKCRA9TVsSAnZWagAAgcAQAKCd+8X5NASpUTgSX3Xe\nlcc/AKsH++axNmQzmFLwgf7OVSPiEJbMzPp2CB0QoOU9HGw4YpxK8bf5OZlE\npl1EWiw4Fn+zT6zjDeZzo6Q7a03Oq66sXPJPV40+gmJt7JW4BLAlXDYEbHbk\nCT8nDuWhakUxtcsGKBWG2sFumau4g43V5wJDNp2MDZjytbMVk8EOh/tSDcCZ\nb5lcKgG+S7bNk7tdqyeTZwHUOQTq4dw78HLdIvGBZrJX2tdQlFaV+DuaRai2\nOLk3GQoxY48posyA/ojtLISkatn3JaOTDFQ8tsZPmTi12inFzlaHIitzRPa3\n8acPGJOVSPVJNlSUAi5D+XPeDxRnHW8WVlOf5v8wgkmgjELTgSGi6zRnNACk\nn66P+tEg+j6QQq7NK6+q+bocrJ4igsJ2D7XBUT8HL/KXPxruoPHjbpczZ9AO\ndGIC8h0jGozLM65M6A3B8OAibZoQ8x/vBBSjVx005AL761ThODbJhi0Koy0h\n5QXH+m0T3qAiZiqapJlVuZJY21wFzAuFVamQ4Fz12zl9C9uJVBBtxakB7DI/\nVJjUV5ecXK4g5s1kxCri96BQ0DTsr+WJvJRQmjjMiM50iKp5cLw53++EkIxP\nQBxT4VTLnafYz8dAyAQoyOsMQanWsiIP/ttOZiEQeKTFo4Cbgmk80N1dr02o\nfBcH\r\n=4cR6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDTYy9tQ1APvqxCNjW3i+1pAs6WYZuNp4otlvH+4MPwMAiBsMZcqqGFAUyfmOgTDnFdfW0t6gqvLd899xzGnof+cyA=="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.10.1-pre.cf38460_1560463241402_0.1084090221625933"},"_hasShrinkwrap":false},"0.10.1-pre.7b144ed":{"name":"ts-protoc-gen","version":"0.10.1-pre.7b144ed","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@bazel/karma":"~0.30.0","@bazel/typescript":"~0.30.0","@improbable-eng/grpc-web":"^0.9.1","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/jasmine":"^2.8.9","@types/lodash":"^4.14.106","@types/minimist":"^1.2.0","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","minimist":"^1.2.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"67b4bc99725fe010aaa4d97ca25b362c565a4f22","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations\n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\n\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build\">bazel</a> build environment</summary><p>\n\nPrerequisites:\n- Setup [rules_nodejs](https://github.com/bazelbuild/rules_nodejs) in your project\n\nThen, include the following in your `WORKSPACE`:\n\n```python\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n\n# NOTE: Setup rules_nodejs\n\nhttp_archive(\n    name = \"ts_protoc_gen\",\n    # NOTE: Update these values to the latest version\n    sha256 = \"355bd8e7a3d4889a3fb222366ac3427229acc968455670378f8ffe1b4bfc5a95\",\n    strip_prefix = \"ts-protoc-gen-14d69f6203c291f15017a8c0abbb1d4b52b00b64\",\n    urls = [\"https://github.com/improbable-eng/ts-protoc-gen/archive/14d69f6203c291f15017a8c0abbb1d4b52b00b64.zip\"],\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\n\ntypescript_proto_dependencies()\n```\n\nAlso make sure you have the following in your `package.json`:\n\n```json\n{\n  \"dependencies\": {\n    \"google-protobuf\": \"^3.6.1\",\n    \"@improbable-eng/grpc-web\": \"0.8.0\",\n    \"browser-headers\": \"^0.4.1\"\n  },\n  \"devDependencies\": {\n    \"@bazel/karma\": \"0.27.8\",\n    \"@bazel/typescript\": \"^0.27.7\",\n    \"@types/google-protobuf\": \"^3.2.7\",\n    \"typescript\": \"^3.1.1\"\n  }\n}\n```\n\n> Run `yarn install` to generate the `yarn.lock` file.\n\nFinally, in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nproto_library(\n  name = \"test_proto\",\n  srcs = [\n    \"test.proto\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"test_ts_proto\",\n  proto = \":test_proto\",\n)\n```\n\nYou can use the `test_ts_proto` as a `dep` in other `ts_library` targets. However, you will need to\ninclude `google-protobuf`, `@improbable-eng/grpc-web`, and `browser-headers` at runtime yourself. See\n`//test/bazel:pizza_service_proto_test_suite` for an example.\n\n#### IDE Code Completion\nIf you'd like to get code completion working for the generated protos in your IDE, add the following to your `tsconfig.json`:\n\n```\n{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"paths\": {\n      # Replace <workspace-name> with the name of your workspace\n      \"<workspace-name>/*\": [\n        \"*\", # Enables absolute paths for src files in your project\n        \"bazel-bin/*\" # Enables referencing generate protos with absolute paths\n      ]\n    }\n  }\n}\n```\n\n> NOTE: This has only been tested in IntelliJ with the bazel plugin\n\n</p></details>\n\n## Contributing\n\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\n\nAs mentioned above, this plugin for `protoc` serves two purposes:\n\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\n\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport {\n  UserServiceClient,\n  GetUserRequest\n} from \"../generated/users_pb_service\";\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => {\n  /* ... */\n});\n```\n\n## Examples\n\n- [Example output](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples) -- Code generated by `ts-protoc-gen`.\n- [Packaging the output as a node module](https://github.com/improbable-eng/ts-protoc-gen/issues/173) -- Example of how to use the generated code as a dependendecy of another module.\n\n## Gotchas\n\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.10.1-pre.7b144ed","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-KKEP7jT/R2OTuMfv7FZW2uvvsex9VzmwAlkaXomvlz1C2/yHXlvkd9C0fhYQg/TMbe03Ykagy4uVFQ0OfN76Bw==","shasum":"6fbdc429622d54770d81fb6f2c57e95d821e9666","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.10.1-pre.7b144ed.tgz","fileCount":79,"unpackedSize":235720,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdAshFCRA9TVsSAnZWagAAFGAQAJe5JmR/aj/bhw0MYPgV\n1+DRY2Ej4E79+hNAiZU6EUPF40POnr6r2P9Ul5dUSX/qcTrS0i/RW0cs9EOW\nhQ/+pX0Ma6Ig6+9qC7D2vrSCf2gqCwxk2DQh61ogZP2uMV5/f15NFg7fjwDe\nP9D1VeH6lM0VQpLWKCbEWAmSQmeiynT5Z1YDEqGbUysMHU96ZO1spbMzgQAm\n8zgbv45fqJVumbEQ/Twyv9hShMNYVVcO6qwOQwH5ghJOfKMyYGo+zdeWO28P\nngbA591iAb0NvY4v8ScJnJaNPqeXTc4K679edKlNfRDqUOTAJJXu97ANYHer\nV0zze/7/6bUKCDnBTDWVnb2s/ix9b5vCUt7ZjFYczoTikf2er3veAdUb70kl\nd5f5k4Ps3VemC/IDoGmgyZ6x4932Pyvukf5xL5NWlT+UUOOuYjaQ+e+mOeV4\nXLLoruykU74jUkf2VNEYoAMR+ifLLKT29deQ4cDxSOtlsL1d1OwD71HqSdGw\nOi4ed1RvoyWvh8TZsUH//uGsDOaPLMW3hURcfuidX1UlU5ZT7rLIjL5j8XGY\nwXbF1CXuCoQPtR/okaLS1qYYQE7fXKr7YGdt+EFzE+TxOSi0lrfG0xm86HnB\nZZwnyhyU2hY9prI4agkzRbGiGgUD/WfqXCCi1o9C6lmZ7+++NIELE3XC19eb\n9BFb\r\n=fNge\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA5tElflsiE5kaYFr71XITOM4/4zie7evY3OLoTHLN+MAiEAh53J4+3dUYhJtYsVnYo9dyEdsfAxobjbVFTJ8iJjo6M="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.10.1-pre.7b144ed_1560463428941_0.33001140432893483"},"_hasShrinkwrap":false},"0.10.1-pre.cbcd353":{"name":"ts-protoc-gen","version":"0.10.1-pre.cbcd353","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@bazel/karma":"~0.30.1","@bazel/typescript":"~0.30.1","@improbable-eng/grpc-web":"^0.9.1","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/jasmine":"^2.8.9","@types/lodash":"^4.14.106","@types/minimist":"^1.2.0","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","minimist":"^1.2.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"8a3ee4cb2a38ae6fd317087f9272377f51531cd5","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations\n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\n\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build\">bazel</a> build environment</summary><p>\n\nPrerequisites:\n- Setup [rules_nodejs](https://github.com/bazelbuild/rules_nodejs) in your project\n\nThen, include the following in your `WORKSPACE`:\n\n```python\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n\n# NOTE: Setup rules_nodejs\n\nhttp_archive(\n    name = \"ts_protoc_gen\",\n    # NOTE: Update these values to the latest version\n    sha256 = \"355bd8e7a3d4889a3fb222366ac3427229acc968455670378f8ffe1b4bfc5a95\",\n    strip_prefix = \"ts-protoc-gen-14d69f6203c291f15017a8c0abbb1d4b52b00b64\",\n    urls = [\"https://github.com/improbable-eng/ts-protoc-gen/archive/14d69f6203c291f15017a8c0abbb1d4b52b00b64.zip\"],\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\n\ntypescript_proto_dependencies()\n```\n\nAlso make sure you have the following in your `package.json`:\n\n```json\n{\n  \"dependencies\": {\n    \"google-protobuf\": \"^3.6.1\",\n    \"@improbable-eng/grpc-web\": \"0.8.0\",\n    \"browser-headers\": \"^0.4.1\"\n  },\n  \"devDependencies\": {\n    \"@bazel/karma\": \"0.27.8\",\n    \"@bazel/typescript\": \"^0.27.7\",\n    \"@types/google-protobuf\": \"^3.2.7\",\n    \"typescript\": \"^3.1.1\"\n  }\n}\n```\n\n> Run `yarn install` to generate the `yarn.lock` file.\n\nFinally, in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nproto_library(\n  name = \"test_proto\",\n  srcs = [\n    \"test.proto\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"test_ts_proto\",\n  proto = \":test_proto\",\n)\n```\n\nYou can use the `test_ts_proto` as a `dep` in other `ts_library` targets. However, you will need to\ninclude `google-protobuf`, `@improbable-eng/grpc-web`, and `browser-headers` at runtime yourself. See\n`//test/bazel:pizza_service_proto_test_suite` for an example.\n\n#### IDE Code Completion\nIf you'd like to get code completion working for the generated protos in your IDE, add the following to your `tsconfig.json`:\n\n```\n{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"paths\": {\n      # Replace <workspace-name> with the name of your workspace\n      \"<workspace-name>/*\": [\n        \"*\", # Enables absolute paths for src files in your project\n        \"bazel-bin/*\" # Enables referencing generate protos with absolute paths\n      ]\n    }\n  }\n}\n```\n\n> NOTE: This has only been tested in IntelliJ with the bazel plugin\n\n</p></details>\n\n## Contributing\n\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\n\nAs mentioned above, this plugin for `protoc` serves two purposes:\n\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\n\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport {\n  UserServiceClient,\n  GetUserRequest\n} from \"../generated/users_pb_service\";\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => {\n  /* ... */\n});\n```\n\n## Examples\n\n- [Example output](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples) -- Code generated by `ts-protoc-gen`.\n- [Packaging the output as a node module](https://github.com/improbable-eng/ts-protoc-gen/issues/173) -- Example of how to use the generated code as a dependendecy of another module.\n\n## Gotchas\n\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.10.1-pre.cbcd353","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-ajPdKqtsuL1rYn6lWPyxUqAxo+0XXM5Rex+aQFl4TM7pFjVWCnpxbi4d1OPvJ2eIHOjHAzClkgBbHKn/3Uk65A==","shasum":"92d5a9f77b7f9ddaa53d4db1a3ae3a1aaca63673","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.10.1-pre.cbcd353.tgz","fileCount":79,"unpackedSize":238675,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdFN3ICRA9TVsSAnZWagAAIQgP/3q8qEltosg7FT858MVX\nxJBrZu8kjYIZNfatxkws5uL2zCgu0KGJgZDv+yP+5RilQQ6gHZP64I9vH9UK\nuYZof7G/HCreM/IkTrl81YJte9Hv8XgXKSz/EEFfbYjy++xyBl57B7a3i5iT\nnCp8ZfjOpLgKI5lzogFV4EatJwMPXDuxP/zpjkyILyvehlDM7IViShTDT0JR\nXBpERPT4lurow99yzFl+ziiL7R/3Yxcax/0zXeiUDnFKHTOj6aSiLVhE6Czc\n8t/Or7hQjP4lpycG0tEuLM45IBtyeb/YnIPXOlZQZz7+fhjFt/ws+RXAanjA\nyQw3hW7JEUZI5t89+GJowAfTdC11o5J9ZuNsGhRBvJZ6578yVK5Uf1VQeqmv\n3sucOD4Unmhle3jT4je2oWgZH+asa2Qof8yg/2kTDlfV01mNUUhARU6mwYo3\n5qgHxChEW6+Dht2PxU5Mzo5iqTRy9WFVQ5MI5fGbuMaeKAlWXtb8/PMC7Dvf\nlBf2HBIvuVxAomlY99TATzaun/1B9ilr+yQTjl3CVQix5kJb+zWtdg1XtLFT\nCvTOdNy1r5Ycuva54GiayxSRSDw2V79K1EX9RLHyl34MCI5xM8fgpAraq7zJ\nG9V4oNZiZ8ad5kejDfLLOvJ0vqDEYXVlI2iVzLPQ6Fs9GwsdJOQ7RjYH7Aum\njFfB\r\n=Jfvj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFhW9IYCdWjMlTi/2UtPlN7NAs9xiYm2o8wCyGy5ljUjAiEAgLdSj4xA1l5QcsLKXA5ZbP3orHdqeHz+X5hOLokZmgc="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.10.1-pre.cbcd353_1561648583884_0.7961513985228164"},"_hasShrinkwrap":false},"0.10.1-pre.2f98b5c":{"name":"ts-protoc-gen","version":"0.10.1-pre.2f98b5c","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@bazel/karma":"~0.30.1","@bazel/typescript":"~0.30.1","@improbable-eng/grpc-web":"^0.9.1","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/jasmine":"^2.8.9","@types/lodash":"^4.14.106","@types/minimist":"^1.2.0","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","minimist":"^1.2.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tslint":"^5.9.1","typescript":"^2.7.2"},"gitHead":"9af69b2f8e40597b0a20a219f4150809d6c48bd0","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations\n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\n\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build\">bazel</a> build environment</summary><p>\n\nPrerequisites:\n- Setup [rules_nodejs](https://github.com/bazelbuild/rules_nodejs) in your project\n\nThen, include the following in your `WORKSPACE`:\n\n```python\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n\n# NOTE: Setup rules_nodejs\n\nhttp_archive(\n    name = \"ts_protoc_gen\",\n    # NOTE: Update these values to the latest version\n    sha256 = \"355bd8e7a3d4889a3fb222366ac3427229acc968455670378f8ffe1b4bfc5a95\",\n    strip_prefix = \"ts-protoc-gen-14d69f6203c291f15017a8c0abbb1d4b52b00b64\",\n    urls = [\"https://github.com/improbable-eng/ts-protoc-gen/archive/14d69f6203c291f15017a8c0abbb1d4b52b00b64.zip\"],\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\n\ntypescript_proto_dependencies()\n```\n\nAlso make sure you have the following in your `package.json`:\n\n```json\n{\n  \"dependencies\": {\n    \"google-protobuf\": \"^3.6.1\",\n    \"@improbable-eng/grpc-web\": \"0.8.0\",\n    \"browser-headers\": \"^0.4.1\"\n  },\n  \"devDependencies\": {\n    \"@bazel/karma\": \"0.27.8\",\n    \"@bazel/typescript\": \"^0.27.7\",\n    \"@types/google-protobuf\": \"^3.2.7\",\n    \"typescript\": \"^3.1.1\"\n  }\n}\n```\n\n> Run `yarn install` to generate the `yarn.lock` file.\n\nFinally, in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nproto_library(\n  name = \"test_proto\",\n  srcs = [\n    \"test.proto\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"test_ts_proto\",\n  proto = \":test_proto\",\n)\n```\n\nYou can use the `test_ts_proto` as a `dep` in other `ts_library` targets. However, you will need to\ninclude `google-protobuf`, `@improbable-eng/grpc-web`, and `browser-headers` at runtime yourself. See\n`//test/bazel:pizza_service_proto_test_suite` for an example.\n\n#### IDE Code Completion\nIf you'd like to get code completion working for the generated protos in your IDE, add the following to your `tsconfig.json`:\n\n```\n{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"paths\": {\n      # Replace <workspace-name> with the name of your workspace\n      \"<workspace-name>/*\": [\n        \"*\", # Enables absolute paths for src files in your project\n        \"bazel-bin/*\" # Enables referencing generate protos with absolute paths\n      ]\n    }\n  }\n}\n```\n\n> NOTE: This has only been tested in IntelliJ with the bazel plugin\n\n</p></details>\n\n## Contributing\n\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\n\nAs mentioned above, this plugin for `protoc` serves two purposes:\n\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\n\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport {\n  UserServiceClient,\n  GetUserRequest\n} from \"../generated/users_pb_service\";\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => {\n  /* ... */\n});\n```\n\n## Examples\n\n- [Example output](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples) -- Code generated by `ts-protoc-gen`.\n- [Packaging the output as a node module](https://github.com/improbable-eng/ts-protoc-gen/issues/173) -- Example of how to use the generated code as a dependendecy of another module.\n\n## Gotchas\n\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.10.1-pre.2f98b5c","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-0g8gmLt5TD1izc6uPbogVhR4/Mo6J55XEe7FJBLctVGX+058Cf78utMVrTvUOnMez++TnMQep7y/Y2GbRGKcMA==","shasum":"ba0e84d0a1fcca7e4a205c916820af807f1647d1","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.10.1-pre.2f98b5c.tgz","fileCount":79,"unpackedSize":238678,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdR/z4CRA9TVsSAnZWagAA2cEP/RP5oRcEOQNzT9VYrWZ9\n4Ck1tjKdngqqsOl3vBm1vgnrk/AmTHgRme4NGHycWtpPft1y3gQlgw0MT2OD\nGvNkhH9BTKnjwb8Wqfptl+BxGDdxuPMzRIKqV6HyXrdPiLO/SlWdz2qdGErG\nKQ+cmfHgiAI+0zTgO3G8vKxZ1ebgKb3Dc2YqUj2RHg5lAh47d0ZHyK+5oosn\npQcIdLpEOmhGtutdcUiKj/mv9S4ciJ7uNvmeXB2WIXI8jr/0RhgvLtavw5sZ\nWZFFjefjrL2KE4C6L+ycidSXoTK2/w1bZowtvuRo/IGPFNTY00z7Eo6+J1i8\nRp4/UfmgNLR3bZZ/pyBrF6/nXVKyps/RJKb8vSXw4YZhQLwiunhv6euY3Lgb\neLzrszzQ78c+SxtSBR+HLDWEeHzmk1/SuB+y2fsrREA8a3ZV6zFej3yMK6MU\n1IVjnnhZ37Tztj3iT8YudzA0BmEglOuB8+16/OonbWR5RKODmIwxq9Aoz7+3\nKwse+uB0+94fPRqS6wIVdtCVVMkp0CPMHS0WkDVRp6YNtX4YC/s37x5w49Hg\nJF2yMo7E3WOigRCoe+Y+r9ftwetyC7t+C0rXs76WK1amJUHkzXM/lVGfS4Rx\nR7lL3bMOcWbkn8GRAFfzlPnspjEK35mlDkYT1Fjbst0pbAyOEHimL8GeUs5K\n3AaF\r\n=0NIx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFYOwkKCJ0sXKGwBA5qP3ALbAJJpopTPaiFTW7hTs+mMAiEA2ypxkCz4/TVlcr9LaS/cRUFwcUeCHZD2KeEiSmS5a3o="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.10.1-pre.2f98b5c_1564998904244_0.14892390005220246"},"_hasShrinkwrap":false},"0.10.1-pre.e3d1c32":{"name":"ts-protoc-gen","version":"0.10.1-pre.e3d1c32","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@bazel/hide-bazel-files":"~0.33.1","@bazel/karma":"~0.33.1","@bazel/typescript":"~0.33.1","@improbable-eng/grpc-web":"^0.9.1","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/jasmine":"^2.8.9","@types/lodash":"^4.14.106","@types/minimist":"^1.2.0","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","minimist":"^1.2.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tsickle":"0.33.1","tslint":"^5.9.1","tsutils":"2.27.2","typescript":"~3.1.6"},"gitHead":"8b7cb6d0c3a5939fc48d2e86e71ce0235bb2557e","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations\n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\n\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build\">bazel</a> build environment</summary><p>\n\nPrerequisites:\n- Setup [rules_nodejs](https://github.com/bazelbuild/rules_nodejs) in your project\n\nThen, include the following in your `WORKSPACE`:\n\n```python\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n\n# NOTE: Setup rules_nodejs\n\nhttp_archive(\n    name = \"ts_protoc_gen\",\n    # NOTE: Update these values to the latest version\n    sha256 = \"355bd8e7a3d4889a3fb222366ac3427229acc968455670378f8ffe1b4bfc5a95\",\n    strip_prefix = \"ts-protoc-gen-14d69f6203c291f15017a8c0abbb1d4b52b00b64\",\n    urls = [\"https://github.com/improbable-eng/ts-protoc-gen/archive/14d69f6203c291f15017a8c0abbb1d4b52b00b64.zip\"],\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\n\ntypescript_proto_dependencies()\n```\n\nAlso make sure you have the following in your `package.json`:\n\n```json\n{\n  \"dependencies\": {\n    \"google-protobuf\": \"^3.6.1\",\n    \"@improbable-eng/grpc-web\": \"0.8.0\",\n    \"browser-headers\": \"^0.4.1\"\n  },\n  \"devDependencies\": {\n    \"@bazel/karma\": \"0.27.8\",\n    \"@bazel/typescript\": \"^0.27.7\",\n    \"@types/google-protobuf\": \"^3.2.7\",\n    \"typescript\": \"^3.1.1\"\n  }\n}\n```\n\n> Run `yarn install` to generate the `yarn.lock` file.\n\nFinally, in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nproto_library(\n  name = \"test_proto\",\n  srcs = [\n    \"test.proto\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"test_ts_proto\",\n  proto = \":test_proto\",\n)\n```\n\nYou can use the `test_ts_proto` as a `dep` in other `ts_library` targets. However, you will need to\ninclude `google-protobuf`, `@improbable-eng/grpc-web`, and `browser-headers` at runtime yourself. See\n`//test/bazel:pizza_service_proto_test_suite` for an example.\n\n#### IDE Code Completion\nIf you'd like to get code completion working for the generated protos in your IDE, add the following to your `tsconfig.json`:\n\n```\n{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"paths\": {\n      # Replace <workspace-name> with the name of your workspace\n      \"<workspace-name>/*\": [\n        \"*\", # Enables absolute paths for src files in your project\n        \"bazel-bin/*\" # Enables referencing generate protos with absolute paths\n      ]\n    }\n  }\n}\n```\n\n> NOTE: This has only been tested in IntelliJ with the bazel plugin\n\n</p></details>\n\n## Contributing\n\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\n\nAs mentioned above, this plugin for `protoc` serves two purposes:\n\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\n\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport {\n  UserServiceClient,\n  GetUserRequest\n} from \"../generated/users_pb_service\";\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => {\n  /* ... */\n});\n```\n\n## Examples\n\n- [Example output](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples) -- Code generated by `ts-protoc-gen`.\n- [Packaging the output as a node module](https://github.com/improbable-eng/ts-protoc-gen/issues/173) -- Example of how to use the generated code as a dependendecy of another module.\n\n## Gotchas\n\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.10.1-pre.e3d1c32","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-niiuQJWvEsUijjmNrJVpJO0JS782oXn26v7gmLTihfWwfy+C69fk2SbcIYp9P2ky7xEexFf5iKT27MWpha0a6w==","shasum":"f26ac7320ad583c641216e239bf055a25ce6b1d4","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.10.1-pre.e3d1c32.tgz","fileCount":79,"unpackedSize":240195,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdR/5sCRA9TVsSAnZWagAAdBUP/03RcLf5Dw5L6aCtlt7s\n+KsKcAiQshcrE1GhfDykR39ofNLtIjCrCcrWtOCl7TgiW30vYF8tZiwRJnSk\nyYvLrJfUFndy6oFs14LqQZA/6Ro+IP5G4rYOBLmUffATzevRx0l+g7iDUMF0\nUfuNfnjjfA73SpBkZ5Wbwu3MEwSt3420+YlEPJ/de/YgklzWR0zIyeCSctYs\nnPlptTo8xVliojQahDaSHsc6gZGKKBSvhUHSE/e8qJdOMo46tVribXla1C04\nBxK0Wqvtl3lvNuWUp2of8/ZM1DoWXXZmGCLPt0AuTtfmwfHPJUtC46CqamyT\n7tFM17LjfYVaCCgohyzrS1hkv+pmQ+hhBse44lMIXvj9Y1MkiCAlMh/5RENd\nC462K0cvpX3czddb89NOys66YTDcrU51ksVlDMaBwIYMejPM9fhyWVXHzh8p\nvKTqUEAcKMRf45Mkxayje0GttyOmZBOL5eg4PWUj9WSNEntQeG3z4/+I9Fbq\nXH+Wr4pFJiKsO8ZePvocNQZGPZZwi+MHGdg81joCYxf3p/OJk/b6rNtz9zGB\noxZHn4WXeRuSi9QWpvREICwf5K8N0VYH7OmmWrn8b6soEOuQc1NuyOWkoCYC\nZ63XeuZ1dFQCZ3Orq4TckOsoQS+fAL6IsZdaMImtwFZI+yPaIydbJ+j+R4mS\nsBZr\r\n=5XF2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEKbHqkF+1VYLPg3XXA/cG/1HRutKGbsWY4lpNS7RznWAiEAxh1RBhEy0uoDJif7qaFVMmGBCZvPRYtQKy+QVaZaa/o="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.10.1-pre.e3d1c32_1564999276127_0.05476755910195896"},"_hasShrinkwrap":false},"0.10.1-pre.c511ff3":{"name":"ts-protoc-gen","version":"0.10.1-pre.c511ff3","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json 'test/**/*.ts' 'src/**/*.ts'","lint:fix":"npm run lint -- --fix","clean":"rm -rf lib","build":"npm run clean && tsc","generate":"./generate.sh","test":"npm run test:unit && npm run test:integration","test:unit":"./test/mocha-run-suite.sh 'test/unit/**/*.ts'","test:integration":"./test/mocha-run-suite.sh 'test/integration/**/*.ts'","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@bazel/hide-bazel-files":"~0.33.1","@bazel/jasmine":"~0.33.1","@bazel/karma":"~0.33.1","@bazel/typescript":"~0.33.1","@improbable-eng/grpc-web":"^0.9.1","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/jasmine":"^2.8.9","@types/lodash":"^4.14.106","@types/minimist":"^1.2.0","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","minimist":"^1.2.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","source-map-support":"^0.4.18","ts-node":"^5.0.1","tsickle":"0.33.1","tslint":"^5.9.1","tsutils":"2.27.2","typescript":"~3.1.6"},"gitHead":"e1f73ca4de8dee3b3c0ddf0f2fc710b58de7bc5f","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations\n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\n\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build\">bazel</a> build environment</summary><p>\n\nPrerequisites:\n- Setup [rules_nodejs](https://github.com/bazelbuild/rules_nodejs) in your project\n\nThen, include the following in your `WORKSPACE`:\n\n```python\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n\n# NOTE: Setup rules_nodejs\n\nhttp_archive(\n    name = \"ts_protoc_gen\",\n    # NOTE: Update these values to the latest version\n    sha256 = \"355bd8e7a3d4889a3fb222366ac3427229acc968455670378f8ffe1b4bfc5a95\",\n    strip_prefix = \"ts-protoc-gen-14d69f6203c291f15017a8c0abbb1d4b52b00b64\",\n    urls = [\"https://github.com/improbable-eng/ts-protoc-gen/archive/14d69f6203c291f15017a8c0abbb1d4b52b00b64.zip\"],\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\n\ntypescript_proto_dependencies()\n```\n\nAlso make sure you have the following in your `package.json`:\n\n```json\n{\n  \"dependencies\": {\n    \"google-protobuf\": \"^3.6.1\",\n    \"@improbable-eng/grpc-web\": \"0.8.0\",\n    \"browser-headers\": \"^0.4.1\"\n  },\n  \"devDependencies\": {\n    \"@bazel/karma\": \"0.27.8\",\n    \"@bazel/typescript\": \"^0.27.7\",\n    \"@types/google-protobuf\": \"^3.2.7\",\n    \"typescript\": \"^3.1.1\"\n  }\n}\n```\n\n> Run `yarn install` to generate the `yarn.lock` file.\n\nFinally, in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nproto_library(\n  name = \"test_proto\",\n  srcs = [\n    \"test.proto\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"test_ts_proto\",\n  proto = \":test_proto\",\n)\n```\n\nYou can use the `test_ts_proto` as a `dep` in other `ts_library` targets. However, you will need to\ninclude `google-protobuf`, `@improbable-eng/grpc-web`, and `browser-headers` at runtime yourself. See\n`//test/bazel:pizza_service_proto_test_suite` for an example.\n\n#### IDE Code Completion\nIf you'd like to get code completion working for the generated protos in your IDE, add the following to your `tsconfig.json`:\n\n```\n{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"paths\": {\n      # Replace <workspace-name> with the name of your workspace\n      \"<workspace-name>/*\": [\n        \"*\", # Enables absolute paths for src files in your project\n        \"bazel-bin/*\" # Enables referencing generate protos with absolute paths\n      ]\n    }\n  }\n}\n```\n\n> NOTE: This has only been tested in IntelliJ with the bazel plugin\n\n</p></details>\n\n## Contributing\n\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\n\nAs mentioned above, this plugin for `protoc` serves two purposes:\n\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\n\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport {\n  UserServiceClient,\n  GetUserRequest\n} from \"../generated/users_pb_service\";\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => {\n  /* ... */\n});\n```\n\n## Examples\n\n- [Example output](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples) -- Code generated by `ts-protoc-gen`.\n- [Packaging the output as a node module](https://github.com/improbable-eng/ts-protoc-gen/issues/173) -- Example of how to use the generated code as a dependendecy of another module.\n\n## Gotchas\n\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.10.1-pre.c511ff3","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-F4LjRqYDjxIHisQB6X16mvilx1vTKmbK3At/cO4L1tQCmBN9se2is6SZa/CaO86PxaHu8TBGQXs5KYzfoUtakg==","shasum":"7ae590abc1905888ec7a70f8c542839a56239867","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.10.1-pre.c511ff3.tgz","fileCount":79,"unpackedSize":264264,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdU7AhCRA9TVsSAnZWagAAwp0P/1kXGSWLeSkd2hlJeCH/\nU8saQUHrXB+ID0GQeDdsQuccbVi/XAZDvzED5ru73sY+FV5DMX6J81cJwUs6\nS1l4tK4oQo0Am7vE9DDghf/VnO/LGqTQgW7Yzxf0RvJUGeHNayI7o2aG/BnF\n5veF+ShHILB2AvFIUIpCDR+jXQ2dE/z3iU/+4HExWyB2G8qOlod/2L1waKqi\nEUgpL7rg9uAS1X0SrXBI99mHZa8cn8iUAl4ce2SSLRi2eJVuqPVE6GtF3B2J\nklpL72p2ACk2tZ+6iPjrveQCgWJWI+ZY2ztA7zPt8SYBoE2WFd19v5R2dNhn\nN49q5ncSvxkp+WcDuKhtM8KEV5EXsB5zjOjHspu2LANXwTQJuEMEHhyJQyLI\nxn1a+pFOXxY7l/j0+MdN6Sz7PxlF2X9rKp3/4Vu1iVTBBn1Aj7PQgPiPzpxJ\nC8mKt+lvDDkQ78AcGC4ixRp3bk44iHV1VMKcKPu/OG0g7t4Cjt5OWzJz2dct\njLwDZ5ispNubDJt4jQm6Q5GJx2AVDsqtmHt+4vMTvbTSJZJTpc62XeiQ3vm3\naceHzdsIv0plK/qo3myxYLagL1EkDxy3lUyZ+ytgUIkKQsK6osLCmCE6Hjjh\nk9hJOxNE7CMLz0Pur8grRzYjFmJDjbOWkPLnH+8CfX1LKysn3WESUGk4jQd4\nBEwU\r\n=eFPn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFA0oQEBGjtBNZ0AyoHnthQRMYqBTGBu5a25GnF7Ir6kAiAi8Ysv1qxF6XK7500BhtnWXPbR7dHCgun5S5NMgzox2g=="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.10.1-pre.c511ff3_1565765665326_0.70139847852428"},"_hasShrinkwrap":false},"0.10.1-pre.7a65c0d":{"name":"ts-protoc-gen","version":"0.10.1-pre.7a65c0d","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json \"test/**/*.ts\" \"src/**/*.ts\"","lint:fix":"npm run lint -- --fix","clean":"rimraf lib","build":"run-s clean tsc","generate":"node generate.js","tsc":"tsc","test":"run-s test:unit test:integration","test:unit":"node test/mocha-run-suite.js \"test/unit/**/*.ts\"","test:integration":"node test/mocha-run-suite.js \"test/integration/**/*.ts\"","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@bazel/hide-bazel-files":"~0.33.1","@bazel/jasmine":"~0.33.1","@bazel/karma":"~0.33.1","@bazel/typescript":"~0.33.1","@improbable-eng/grpc-web":"^0.9.1","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/jasmine":"^2.8.9","@types/lodash":"^4.14.106","@types/minimist":"^1.2.0","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","download-cli":"^1.1.1","glob":"^7.1.4","lodash":"^4.17.5","lodash.isequal":"^4.5.0","minimist":"^1.2.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","npm-run-all":"^4.1.5","rimraf":"^2.6.3","source-map-support":"^0.4.18","ts-node":"^5.0.1","tsickle":"0.33.1","tslint":"^5.9.1","tsutils":"2.27.2","typescript":"~3.1.6"},"gitHead":"61cdebaa32dbe6415e923201ab9350e300849cca","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations\n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\n\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build\">bazel</a> build environment</summary><p>\n\nPrerequisites:\n- Setup [rules_nodejs](https://github.com/bazelbuild/rules_nodejs) in your project\n\nThen, include the following in your `WORKSPACE`:\n\n```python\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n\n# NOTE: Setup rules_nodejs\n\nhttp_archive(\n    name = \"ts_protoc_gen\",\n    # NOTE: Update these values to the latest version\n    sha256 = \"355bd8e7a3d4889a3fb222366ac3427229acc968455670378f8ffe1b4bfc5a95\",\n    strip_prefix = \"ts-protoc-gen-14d69f6203c291f15017a8c0abbb1d4b52b00b64\",\n    urls = [\"https://github.com/improbable-eng/ts-protoc-gen/archive/14d69f6203c291f15017a8c0abbb1d4b52b00b64.zip\"],\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\n\ntypescript_proto_dependencies()\n```\n\nAlso make sure you have the following in your `package.json`:\n\n```json\n{\n  \"dependencies\": {\n    \"google-protobuf\": \"^3.6.1\",\n    \"@improbable-eng/grpc-web\": \"0.8.0\",\n    \"browser-headers\": \"^0.4.1\"\n  },\n  \"devDependencies\": {\n    \"@bazel/karma\": \"0.27.8\",\n    \"@bazel/typescript\": \"^0.27.7\",\n    \"@types/google-protobuf\": \"^3.2.7\",\n    \"typescript\": \"^3.1.1\"\n  }\n}\n```\n\n> Run `yarn install` to generate the `yarn.lock` file.\n\nFinally, in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nproto_library(\n  name = \"test_proto\",\n  srcs = [\n    \"test.proto\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"test_ts_proto\",\n  proto = \":test_proto\",\n)\n```\n\nYou can use the `test_ts_proto` as a `dep` in other `ts_library` targets. However, you will need to\ninclude `google-protobuf`, `@improbable-eng/grpc-web`, and `browser-headers` at runtime yourself. See\n`//test/bazel:pizza_service_proto_test_suite` for an example.\n\n#### IDE Code Completion\nIf you'd like to get code completion working for the generated protos in your IDE, add the following to your `tsconfig.json`:\n\n```\n{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"paths\": {\n      # Replace <workspace-name> with the name of your workspace\n      \"<workspace-name>/*\": [\n        \"*\", # Enables absolute paths for src files in your project\n        \"bazel-bin/*\" # Enables referencing generate protos with absolute paths\n      ]\n    }\n  }\n}\n```\n\n> NOTE: This has only been tested in IntelliJ with the bazel plugin\n\n</p></details>\n\n## Contributing\n\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\n\nAs mentioned above, this plugin for `protoc` serves two purposes:\n\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\n\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=true` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=true:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport {\n  UserServiceClient,\n  GetUserRequest\n} from \"../generated/users_pb_service\";\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => {\n  /* ... */\n});\n```\n\n## Examples\n\n- [Example output](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples) -- Code generated by `ts-protoc-gen`.\n- [Packaging the output as a node module](https://github.com/improbable-eng/ts-protoc-gen/issues/173) -- Example of how to use the generated code as a dependendecy of another module.\n\n## Gotchas\n\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.10.1-pre.7a65c0d","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-E0/L2suGlSAlcARvVh2EOFH0QdpdquZ6xWBjaj201Al+y6EOxfX1QCFki3OZ7rYXd2aQ+ViUIgc9srnXo8CQ/A==","shasum":"14be9f9a6f33d6a9730f5bd140fb8a6e28b27b9e","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.10.1-pre.7a65c0d.tgz","fileCount":81,"unpackedSize":299635,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdVl9HCRA9TVsSAnZWagAALoUQAKIBTqRnk/LINr4ITTqz\nF5WqcPVvqCsYp+CL/u/UI9u0qVXresmdjhW6niD0dc/qyxdliJZhuEPJk7Mo\neOmbeWHpTmCQufZdHR/PuKICRlCWMCXZu2ppBtOrZLIheFwiVYW0veuS7cuz\ncnGneRieSo3z5CTFQoSpfQ6T/ttG+NbB9t5TViaTZsYlipMtvLPBcmR7z/na\nZLp8QBWkahIvq1IUYyIuK5FpuJT3BmShLFlgPR73YxU2iRV8ITPSQLS2t0pn\n6ikunQz06ha3gpCPYcJcyPpUr3dsQ4oa8T2BnT4GNogX5lR12snNXaQZODpE\nmEq6T8B9mF4oPgM5/JdHEUUo2EUE3U/08yky+KMiHmL0znOYjXbgc4sBvh2p\nif3PmeXx0S+iys6w3JerE0LZkM0cyRZ432YG51zp/3wLDxdQuhwmmyIOfpLH\nc7xLeAsaoTWpPEO96Gv/RpvGJOu/tf4PqYF1CSz15tMcrMufbXb6BuA5vhtk\njTyu6pBnLktS6a86DAdsKrjeCFRMTO09Xs3woBu1CswhRw/EXBv6eVf7+0po\naTt166DWntqciXAc3E1e7F1dsK6ZjTr81BEIjxtieXNVaEf2Da28i/DFO/y4\nRbFZAxrjzxGFtZzhmXlygiosBGqnhp/grI3sYdaSVKnujntr9zt8NAZXjYlg\nyd8k\r\n=H5dx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHj+39FaAch3y1DqIbAj1Js3CRYyNlzMrj7juriQWYErAiEAmlZKTyuuMwR31hqDwSafPtA2Lixc6M/lOT5OrNmWl24="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.10.1-pre.7a65c0d_1565941575074_0.17366751990840834"},"_hasShrinkwrap":false},"0.10.1-pre.005b479":{"name":"ts-protoc-gen","version":"0.10.1-pre.005b479","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json \"test/**/*.ts\" \"src/**/*.ts\"","lint:fix":"npm run lint -- --fix","clean":"rimraf lib","build":"run-s clean tsc","generate":"node generate.js","tsc":"tsc","test":"run-s test:unit test:integration","test:unit":"node test/mocha-run-suite.js \"test/unit/**/*.ts\"","test:integration":"node test/mocha-run-suite.js \"test/integration/**/*.ts\"","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@bazel/hide-bazel-files":"~0.33.1","@bazel/jasmine":"~0.33.1","@bazel/karma":"~0.33.1","@bazel/typescript":"~0.33.1","@improbable-eng/grpc-web":"^0.9.1","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/jasmine":"^2.8.9","@types/lodash":"^4.14.106","@types/minimist":"^1.2.0","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","download-cli":"^1.1.1","glob":"^7.1.4","grpc":"^1.22.2","grpc-tools":"^1.8.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","minimist":"^1.2.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","npm-run-all":"^4.1.5","rimraf":"^2.6.3","source-map-support":"^0.4.18","ts-node":"^8.3.0","tsickle":"0.33.1","tslint":"^5.9.1","tsutils":"2.27.2","typescript":"~3.1.6"},"gitHead":"85ededf7c69f6110de58ead03daa36deaa718402","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations\n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web), and as `.d.ts` files in the structure required by [grpc-node](https://github.com/grpc/grpc-node).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\n\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build\">bazel</a> build environment</summary><p>\n\nPrerequisites:\n- Setup [rules_nodejs](https://github.com/bazelbuild/rules_nodejs) in your project\n\nThen, include the following in your `WORKSPACE`:\n\n```python\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n\n# NOTE: Setup rules_nodejs\n\nhttp_archive(\n    name = \"ts_protoc_gen\",\n    # NOTE: Update these values to the latest version\n    sha256 = \"355bd8e7a3d4889a3fb222366ac3427229acc968455670378f8ffe1b4bfc5a95\",\n    strip_prefix = \"ts-protoc-gen-14d69f6203c291f15017a8c0abbb1d4b52b00b64\",\n    urls = [\"https://github.com/improbable-eng/ts-protoc-gen/archive/14d69f6203c291f15017a8c0abbb1d4b52b00b64.zip\"],\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\n\ntypescript_proto_dependencies()\n```\n\nAlso make sure you have the following in your `package.json`:\n\n```json\n{\n  \"dependencies\": {\n    \"google-protobuf\": \"^3.6.1\",\n    \"@improbable-eng/grpc-web\": \"0.8.0\",\n    \"browser-headers\": \"^0.4.1\"\n  },\n  \"devDependencies\": {\n    \"@bazel/karma\": \"0.27.8\",\n    \"@bazel/typescript\": \"^0.27.7\",\n    \"@types/google-protobuf\": \"^3.2.7\",\n    \"typescript\": \"^3.1.1\"\n  }\n}\n```\n\n> Run `yarn install` to generate the `yarn.lock` file.\n\nFinally, in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nproto_library(\n  name = \"test_proto\",\n  srcs = [\n    \"test.proto\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"test_ts_proto\",\n  proto = \":test_proto\",\n)\n```\n\nYou can use the `test_ts_proto` as a `dep` in other `ts_library` targets. However, you will need to\ninclude `google-protobuf`, `@improbable-eng/grpc-web`, and `browser-headers` at runtime yourself. See\n`//test/bazel:pizza_service_proto_test_suite` for an example.\n\n#### IDE Code Completion\nIf you'd like to get code completion working for the generated protos in your IDE, add the following to your `tsconfig.json`:\n\n```\n{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"paths\": {\n      # Replace <workspace-name> with the name of your workspace\n      \"<workspace-name>/*\": [\n        \"*\", # Enables absolute paths for src files in your project\n        \"bazel-bin/*\" # Enables referencing generate protos with absolute paths\n      ]\n    }\n  }\n}\n```\n\n> NOTE: This has only been tested in IntelliJ with the bazel plugin\n\n</p></details>\n\n## Contributing\n\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\n\nAs mentioned above, this plugin for `protoc` serves two purposes:\n\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC Service Stubs for use with [grpc-web](https://github.com/improbable-eng/grpc-web).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\n\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=grpc-web` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=grpc-web:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport {\n  UserServiceClient,\n  GetUserRequest\n} from \"../generated/users_pb_service\";\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => {\n  /* ... */\n});\n```\n\n### Generating gRPC Service Stubs for use with grpc-node\n\nThis plugin can generate `.d.ts` files for gRPC service definitions as required by [grpc-node](https://github.com/grpc/grpc-node).\n\nTo generate these declaration files from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=grpc-node` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Path to the grpc_node_plugin\nPROTOC_GEN_GRPC_PATH=\"./node_modules/.bin/grpc_tools_node_protoc_plugin\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --plugin=protoc-gen-grpc=${PROTOC_GEN_GRPC_PATH} \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=grpc-node:${OUT_DIR}\" \\\n    --grpc_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `_grpc_pb.js` and `_grpc_pb.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** This plugin does not generate the `_grpc_pb.js` files itself; those are generated by the protoc-gen-grpc plugin. This plugin only generates the `_grpc_pb.d.ts` files.\n\n\n## Examples\n\n- [Example output](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples) -- Code generated by `ts-protoc-gen`.\n- [Packaging the output as a node module](https://github.com/improbable-eng/ts-protoc-gen/issues/173) -- Example of how to use the generated code as a dependendecy of another module.\n\n## Gotchas\n\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.10.1-pre.005b479","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-eiTZulD1YQgJz9cjZRpRAOEEJ4G+U7DEeEKtZ4Z0cXqGjp39CBqWtbDOvSVPLtylLHrjKRgiV7FNcffpkQ3rgw==","shasum":"8561145b38959eab729eaae7300e532735e10258","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.10.1-pre.005b479.tgz","fileCount":87,"unpackedSize":320940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdaEdRCRA9TVsSAnZWagAAlyAP/i35atDRJCtqA7AhgsCw\nNr+owplC5wXyJcX8yxESTsNYlTqYEdjUDsjk0dl9F6ol7V5NgvG7EpR0caAE\nJOdBPJ1KZZy5GwIdt7XE7radUdOwqm56fXfjAuAnr3vxw+zD7YTJ8D1XQJuc\nf1dXVPGhaa3of1tAYmesoO+ItPNHZxI3pjq5EFcOjpsDxOuAxfl6VKo/qv4B\n/dYTTJwZ+GgiRRFaDzSdsHFIo7JjffVJdxhpOnMoi6kckynPe5TZubL9VO7g\ngVCHou/+RKGnkaQfkNmvo6UMvmPj9sYTCWoPNP/UgyUi5yZSZsqyW7cqg/PD\nahTYJ9omvxE4u/Bm7uERQxFInSMcOIHUujb+6N9tstyFYk4gaM2zwexBLXiY\n9EGuceJhXUF4ifWuKv8+BzbmiTDv2EZqHVTl7tiztrlbX2zXBUn7cNBCVMHg\nmmpAqltqVvqBFRc9G4SRaW5wDdwITwASD5kMDVS9DnjxJ3475KhsM+QerJZC\nxhaB1AkaDmHPzFrZhvB8SRU/69H1thmpz78yMelD2JTFFmJjbBrMGGUlbD5O\n1UH3IeOHJCZiQtLc153H2q/dkVAR31Ln6VQA8a0/x9tHPBiRijm6X8yG6beV\n9/zmlD5FitzYN/aYHdji0J/Uw4kn1dYb4QTuclCyWtSpbO/vbsytGvPITWbA\nW+Pv\r\n=2E82\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHcRrtLXrDwWKCJ6dtdwiSy9RDcahnHB8UoWZTnknwbxAiEAmzT4yqxaWDoxu8Kxzlo+4PVDoVaeKOOJ/jAH7JdAxgE="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.10.1-pre.005b479_1567115088527_0.6119149238709296"},"_hasShrinkwrap":false},"0.10.1-pre.7a3d3c8":{"name":"ts-protoc-gen","version":"0.10.1-pre.7a3d3c8","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json \"test/**/*.ts\" \"src/**/*.ts\"","lint:fix":"npm run lint -- --fix","clean":"rimraf lib","build":"run-s clean tsc","generate":"node generate.js","tsc":"tsc","test":"run-s test:unit test:integration","test:unit":"node test/mocha-run-suite.js \"test/unit/**/*.ts\"","test:integration":"node test/mocha-run-suite.js \"test/integration/**/*.ts\"","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@bazel/hide-bazel-files":"~0.33.1","@bazel/jasmine":"~0.33.1","@bazel/karma":"~0.33.1","@bazel/typescript":"~0.33.1","@improbable-eng/grpc-web":"^0.9.1","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/jasmine":"^2.8.9","@types/lodash":"^4.14.106","@types/minimist":"^1.2.0","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","download-cli":"^1.1.1","glob":"^7.1.4","grpc":"^1.22.2","grpc-tools":"^1.8.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","minimist":"^1.2.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","npm-run-all":"^4.1.5","rimraf":"^2.6.3","source-map-support":"^0.4.18","ts-node":"^8.3.0","tsickle":"0.33.1","tslint":"^5.9.1","tsutils":"2.27.2","typescript":"~3.1.6"},"gitHead":"7dd9424ed29b48369749a6295474cb73b77f1a60","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations\n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web), and as `.d.ts` files in the structure required by [grpc-node](https://github.com/grpc/grpc-node).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\n\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build\">bazel</a> build environment</summary><p>\n\nPrerequisites:\n- Setup [rules_nodejs](https://github.com/bazelbuild/rules_nodejs) in your project\n\nThen, include the following in your `WORKSPACE`:\n\n```python\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n\n# NOTE: Setup rules_nodejs\n\nhttp_archive(\n    name = \"ts_protoc_gen\",\n    # NOTE: Update these values to the latest version\n    sha256 = \"355bd8e7a3d4889a3fb222366ac3427229acc968455670378f8ffe1b4bfc5a95\",\n    strip_prefix = \"ts-protoc-gen-14d69f6203c291f15017a8c0abbb1d4b52b00b64\",\n    urls = [\"https://github.com/improbable-eng/ts-protoc-gen/archive/14d69f6203c291f15017a8c0abbb1d4b52b00b64.zip\"],\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\n\ntypescript_proto_dependencies()\n```\n\nAlso make sure you have the following in your `package.json`:\n\n```json\n{\n  \"dependencies\": {\n    \"google-protobuf\": \"^3.6.1\",\n    \"@improbable-eng/grpc-web\": \"0.8.0\",\n    \"browser-headers\": \"^0.4.1\"\n  },\n  \"devDependencies\": {\n    \"@bazel/karma\": \"0.27.8\",\n    \"@bazel/typescript\": \"^0.27.7\",\n    \"@types/google-protobuf\": \"^3.2.7\",\n    \"typescript\": \"^3.1.1\"\n  }\n}\n```\n\n> Run `yarn install` to generate the `yarn.lock` file.\n\nFinally, in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nproto_library(\n  name = \"test_proto\",\n  srcs = [\n    \"test.proto\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"test_ts_proto\",\n  proto = \":test_proto\",\n)\n```\n\nYou can use the `test_ts_proto` as a `dep` in other `ts_library` targets. However, you will need to\ninclude `google-protobuf`, `@improbable-eng/grpc-web`, and `browser-headers` at runtime yourself. See\n`//test/bazel:pizza_service_proto_test_suite` for an example.\n\n#### IDE Code Completion\nIf you'd like to get code completion working for the generated protos in your IDE, add the following to your `tsconfig.json`:\n\n```\n{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"paths\": {\n      # Replace <workspace-name> with the name of your workspace\n      \"<workspace-name>/*\": [\n        \"*\", # Enables absolute paths for src files in your project\n        \"bazel-bin/*\" # Enables referencing generate protos with absolute paths\n      ]\n    }\n  }\n}\n```\n\n> NOTE: This has only been tested in IntelliJ with the bazel plugin\n\n</p></details>\n\n## Contributing\n\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\n\nAs mentioned above, this plugin for `protoc` serves two purposes:\n\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC service clients for use with [grpc-web](https://github.com/improbable-eng/grpc-web) or [grpc-node](https://github.com/grpc/grpc-node).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\n\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=grpc-web` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=grpc-web:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport {\n  UserServiceClient,\n  GetUserRequest\n} from \"../generated/users_pb_service\";\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => {\n  /* ... */\n});\n```\n\n### Generating gRPC Service Stubs for use with grpc-node\n\nThis plugin can generate `.d.ts` files for gRPC service definitions as required by [grpc-node](https://github.com/grpc/grpc-node).\n\nTo generate these declaration files from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=grpc-node` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Path to the grpc_node_plugin\nPROTOC_GEN_GRPC_PATH=\"./node_modules/.bin/grpc_tools_node_protoc_plugin\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --plugin=protoc-gen-grpc=${PROTOC_GEN_GRPC_PATH} \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=grpc-node:${OUT_DIR}\" \\\n    --grpc_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `_grpc_pb.js` and `_grpc_pb.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** This plugin does not generate the `_grpc_pb.js` files itself; those are generated by the protoc-gen-grpc plugin. This plugin only generates the `_grpc_pb.d.ts` files.\n\n\n## Examples\n\n- [Example output](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples) -- Code generated by `ts-protoc-gen`.\n- [Packaging the output as a node module](https://github.com/improbable-eng/ts-protoc-gen/issues/173) -- Example of how to use the generated code as a dependendecy of another module.\n\n## Gotchas\n\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.10.1-pre.7a3d3c8","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-2d7EPZKsnsFaqyzD8HnkhplnwvkuJz94DWFeaxqo7EC6uaGoKBpj342FiIGdomMZAt1bvSjbYEwbdJVoFwdqIQ==","shasum":"9682f5656aa5447aad43dc3d1e6eb01b96957ffc","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.10.1-pre.7a3d3c8.tgz","fileCount":87,"unpackedSize":320992,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdaEhnCRA9TVsSAnZWagAAiMMP/j4YiHA0oAjOJEYTQ2k3\n/dPB0D0RsMOd5wxu0wDvryWKy2D7GCO9oqKLVweOmPtsthcpNC//ltZZC3Ye\nIBc+/ZJgZti+qhM8nOyJOLG43jNWfWW5s8bTLi/TsckhtsE7TiUpOoAmXXWu\nTM/gwb9kKg3hv9nzSWrmlKtBDRwJbsFPhyBTkekk8S57lfDN4cg7WzswR8kY\n6cpV+YBOZya3PvPtkNj5lcFcq62kqdzaNj2Z5m+7p9pIEfHGZwzj9obqAoQR\nRea2aiqSdyKSoffU06dMP1wfjnuSoAAWwTWI9jNyZtsvDVbRDVXLbBBO6ij3\nINgaV1mGB0LK9PZ+LyohXi/EEMB4wU36jV4DWTsrIqH7ST1VEkw4V1ipxl2B\n7dPry1NMzJORQvls8oEWdQnSPqp5jHNn+dYIQWUoYwbk7n0yLjYHNJnJ/TTV\nQck9xU6vHWr+YGuRV8xvqvWwnczXOJ3sLfynX0Rr/FArEJr5GQcEic9ur/NC\nJt8jq5xyjRwfZRbjEiEh0h7p5j1i2CkTYXZqegawXdPqgIMBgtBrB4yizibZ\nYq/FI7ePj81M9ODXaq9TY/C4aDk5iHEXXEqSMvI9MV11b63ah8OW5fchHV46\nmIbYr3MNCBxAypPtjvoLkzfWiOTgjd9lz+kReKaEBPRacjsmpYx+Iv1B7d/f\nvU16\r\n=BIjS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQClHUMCumAOlRcVckHvuD5YObop51Epb8ppZkBsYtKjpwIhAPGGuevfQaTvoiOyOal/XFsFG010keZ+Zfo8AtTqoyI3"}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.10.1-pre.7a3d3c8_1567115366739_0.3786161057225599"},"_hasShrinkwrap":false},"0.10.1-pre.90f1ac5":{"name":"ts-protoc-gen","version":"0.10.1-pre.90f1ac5","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json \"test/**/*.ts\" \"src/**/*.ts\"","lint:fix":"npm run lint -- --fix","clean":"rimraf lib","build":"run-s clean tsc","generate":"node generate.js","tsc":"tsc","test":"run-s test:unit test:integration","test:unit":"node test/mocha-run-suite.js \"test/unit/**/*.ts\"","test:integration":"node test/mocha-run-suite.js \"test/integration/**/*.ts\"","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@bazel/hide-bazel-files":"~0.33.1","@bazel/jasmine":"~0.33.1","@bazel/karma":"~0.33.1","@bazel/typescript":"~0.33.1","@improbable-eng/grpc-web":"^0.9.1","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/jasmine":"^2.8.9","@types/lodash":"^4.14.106","@types/minimist":"^1.2.0","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","download-cli":"^1.1.1","glob":"^7.1.4","grpc":"^1.22.2","grpc-tools":"^1.8.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","minimist":"^1.2.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","npm-run-all":"^4.1.5","rimraf":"^2.6.3","source-map-support":"^0.4.18","ts-node":"^8.3.0","tsickle":"0.33.1","tslint":"^5.9.1","tsutils":"2.27.2","typescript":"~3.1.6"},"gitHead":"18db796101b11a2ad4042571ea6ace5576c51136","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations\n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web), and as `.d.ts` files in the structure required by [grpc-node](https://github.com/grpc/grpc-node).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\n\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build\">bazel</a> build environment</summary><p>\n\nPrerequisites:\n- Setup [rules_nodejs](https://github.com/bazelbuild/rules_nodejs) in your project\n\nThen, include the following in your `WORKSPACE`:\n\n```python\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n\n# NOTE: Setup rules_nodejs\n\nhttp_archive(\n    name = \"ts_protoc_gen\",\n    # NOTE: Update these values to the latest version\n    sha256 = \"355bd8e7a3d4889a3fb222366ac3427229acc968455670378f8ffe1b4bfc5a95\",\n    strip_prefix = \"ts-protoc-gen-14d69f6203c291f15017a8c0abbb1d4b52b00b64\",\n    urls = [\"https://github.com/improbable-eng/ts-protoc-gen/archive/14d69f6203c291f15017a8c0abbb1d4b52b00b64.zip\"],\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\n\ntypescript_proto_dependencies()\n```\n\nAlso make sure you have the following in your `package.json`:\n\n```json\n{\n  \"dependencies\": {\n    \"google-protobuf\": \"^3.6.1\",\n    \"@improbable-eng/grpc-web\": \"0.8.0\",\n    \"browser-headers\": \"^0.4.1\"\n  },\n  \"devDependencies\": {\n    \"@bazel/karma\": \"0.27.8\",\n    \"@bazel/typescript\": \"^0.27.7\",\n    \"@types/google-protobuf\": \"^3.2.7\",\n    \"typescript\": \"^3.1.1\"\n  }\n}\n```\n\n> Run `yarn install` to generate the `yarn.lock` file.\n\nFinally, in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nproto_library(\n  name = \"test_proto\",\n  srcs = [\n    \"test.proto\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"test_ts_proto\",\n  proto = \":test_proto\",\n)\n```\n\nYou can use the `test_ts_proto` as a `dep` in other `ts_library` targets. However, you will need to\ninclude `google-protobuf`, `@improbable-eng/grpc-web`, and `browser-headers` at runtime yourself. See\n`//test/bazel:pizza_service_proto_test_suite` for an example.\n\n#### IDE Code Completion\nIf you'd like to get code completion working for the generated protos in your IDE, add the following to your `tsconfig.json`:\n\n```\n{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"paths\": {\n      # Replace <workspace-name> with the name of your workspace\n      \"<workspace-name>/*\": [\n        \"*\", # Enables absolute paths for src files in your project\n        \"bazel-bin/*\" # Enables referencing generate protos with absolute paths\n      ]\n    }\n  }\n}\n```\n\n> NOTE: This has only been tested in IntelliJ with the bazel plugin\n\n</p></details>\n\n## Contributing\n\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\n\nAs mentioned above, this plugin for `protoc` serves two purposes:\n\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC service clients for use with [grpc-web](https://github.com/improbable-eng/grpc-web) or [grpc-node](https://github.com/grpc/grpc-node).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\n\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=grpc-web` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=grpc-web:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport {\n  UserServiceClient,\n  GetUserRequest\n} from \"../generated/users_pb_service\";\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => {\n  /* ... */\n});\n```\n\n### Generating gRPC Service Stubs for use with grpc-node\n\nThis plugin can generate `.d.ts` files for gRPC service definitions as required by [grpc-node](https://github.com/grpc/grpc-node).\n\nTo generate these declaration files from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=grpc-node` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Path to the grpc_node_plugin\nPROTOC_GEN_GRPC_PATH=\"./node_modules/.bin/grpc_tools_node_protoc_plugin\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --plugin=protoc-gen-grpc=${PROTOC_GEN_GRPC_PATH} \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=grpc-node:${OUT_DIR}\" \\\n    --grpc_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `_grpc_pb.js` and `_grpc_pb.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** This plugin does not generate the `_grpc_pb.js` files itself; those are generated by the protoc-gen-grpc plugin. This plugin only generates the `_grpc_pb.d.ts` files.\n\n\n## Examples\n\n- [Example output](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples) -- Code generated by `ts-protoc-gen`.\n- [Packaging the output as a node module](https://github.com/improbable-eng/ts-protoc-gen/issues/173) -- Example of how to use the generated code as a dependendecy of another module.\n\n## Gotchas\n\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.10.1-pre.90f1ac5","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-tKHTWOR3oyUgleAEUHO+1RIc1mnLde3RL1JzNsGxr9PgJqRr6z3Jt9uJRo/UH4XGT81ySi3sN3KfdpwzH4WnUw==","shasum":"5e84d5b0bb99dc796727fad7dbb16e63ad7a7989","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.10.1-pre.90f1ac5.tgz","fileCount":87,"unpackedSize":321421,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdaLkRCRA9TVsSAnZWagAAxWcP/iOxt2KtaDyaJFQeWNCG\nGsN47X/B7rspus9a8mZmgrIWaC6ix14ULxQTe9xTqzF/jHhJYNk/F0cAZ4yV\nlVAIl+05deG074dkA52WAoNU75smSq9wHGYZ+g3U/00S9e4Co1IyrMrVZbF7\nBl6hcpZUR8dPdLa+o0LVDj3Y/b4JYL4JriK64gCEq0PZuznnPm0E9OVZqqvU\nwPlkdDox+bXdMe2O7K91hsTUJHV+bXLYKxyjANHYmtPmDx8rmlbqAFOr8gZs\nJLFoRqrX2AFofzlLHqS7ZPC2+1/Z+rsanxUoHeiUAwSeIgG8A+DS8f0B/Fte\nOeyQ5lKXw7sEytGBMJ6btlao8V3Cj/1dXIZBPn+rLMmdcHQjG6V+V+d4xpF/\nmzJZpCriMvoDbuWT/HJmI3vmLB2K9XmXBA+aNLWytZYlxfcf32lghKSkGhe6\n4a05Bsp1GKNSeQHwalqwnbTbjQJdwb6kDhe/zkZzsOiE6M43kYEg6hOTvjFI\nhArx3HkVBAC+LXlSpBN90oaPJG0tDAwYWYmi5RTbco/67fb6ni7RePxWDGQ0\notJHwpJOHlJZ8iiTzuShPCztW2lNsvtdGhiLSsZUjUQKDT47OUePs0YTTziS\niM5YwGcA/syzJPECRLzPGhU7vqfrPm1vsUZNRRL56S6xTj0vJQ2FcbCJGgDf\n0JaP\r\n=22Wa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIClO1XUejd8sJOkc1uThkYh7pUenC/4UpD2sjOBeckX2AiEAqXVN7NmZusiAVE3TXP4G7o0+uYARdLWQp9vlmKmuVYA="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.10.1-pre.90f1ac5_1567144208687_0.34428099421429015"},"_hasShrinkwrap":false},"0.10.1-pre.252fec7":{"name":"ts-protoc-gen","version":"0.10.1-pre.252fec7","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json \"test/**/*.ts\" \"src/**/*.ts\"","lint:fix":"npm run lint -- --fix","clean":"rimraf lib","build":"run-s clean tsc","generate":"node generate.js","tsc":"tsc","test":"run-s test:unit test:integration","test:unit":"node test/mocha-run-suite.js \"test/unit/**/*.ts\"","test:integration":"node test/mocha-run-suite.js \"test/integration/**/*.ts\"","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@bazel/hide-bazel-files":"~0.33.1","@bazel/jasmine":"~0.33.1","@bazel/karma":"~0.33.1","@bazel/typescript":"~0.33.1","@improbable-eng/grpc-web":"^0.9.1","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/jasmine":"^2.8.9","@types/lodash":"^4.14.106","@types/minimist":"^1.2.0","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","download-cli":"^1.1.1","glob":"^7.1.4","grpc":"^1.22.2","grpc-tools":"^1.8.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","minimist":"^1.2.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","npm-run-all":"^4.1.5","rimraf":"^2.6.3","source-map-support":"^0.4.18","ts-node":"^8.3.0","tsickle":"0.33.1","tslint":"^5.9.1","tsutils":"2.27.2","typescript":"~3.1.6"},"gitHead":"9b16c68a0cdd699a36d06182956d08360d9ca9d3","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations\n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web), and as `.d.ts` files in the structure required by [grpc-node](https://github.com/grpc/grpc-node).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\n\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build\">bazel</a> build environment</summary><p>\n\nPrerequisites:\n- Setup [rules_nodejs](https://github.com/bazelbuild/rules_nodejs) in your project\n\nThen, include the following in your `WORKSPACE`:\n\n```python\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n\n# NOTE: Setup rules_nodejs\n\nhttp_archive(\n    name = \"ts_protoc_gen\",\n    # NOTE: Update these values to the latest version\n    sha256 = \"355bd8e7a3d4889a3fb222366ac3427229acc968455670378f8ffe1b4bfc5a95\",\n    strip_prefix = \"ts-protoc-gen-14d69f6203c291f15017a8c0abbb1d4b52b00b64\",\n    urls = [\"https://github.com/improbable-eng/ts-protoc-gen/archive/14d69f6203c291f15017a8c0abbb1d4b52b00b64.zip\"],\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\n\ntypescript_proto_dependencies()\n```\n\nAlso make sure you have the following in your `package.json`:\n\n```json\n{\n  \"dependencies\": {\n    \"google-protobuf\": \"^3.6.1\",\n    \"@improbable-eng/grpc-web\": \"0.8.0\",\n    \"browser-headers\": \"^0.4.1\"\n  },\n  \"devDependencies\": {\n    \"@bazel/karma\": \"0.27.8\",\n    \"@bazel/typescript\": \"^0.27.7\",\n    \"@types/google-protobuf\": \"^3.2.7\",\n    \"typescript\": \"^3.1.1\"\n  }\n}\n```\n\n> Run `yarn install` to generate the `yarn.lock` file.\n\nFinally, in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nproto_library(\n  name = \"test_proto\",\n  srcs = [\n    \"test.proto\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"test_ts_proto\",\n  proto = \":test_proto\",\n)\n```\n\nYou can use the `test_ts_proto` as a `dep` in other `ts_library` targets. However, you will need to\ninclude `google-protobuf`, `@improbable-eng/grpc-web`, and `browser-headers` at runtime yourself. See\n`//test/bazel:pizza_service_proto_test_suite` for an example.\n\n#### IDE Code Completion\nIf you'd like to get code completion working for the generated protos in your IDE, add the following to your `tsconfig.json`:\n\n```\n{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"paths\": {\n      # Replace <workspace-name> with the name of your workspace\n      \"<workspace-name>/*\": [\n        \"*\", # Enables absolute paths for src files in your project\n        \"bazel-bin/*\" # Enables referencing generate protos with absolute paths\n      ]\n    }\n  }\n}\n```\n\n> NOTE: This has only been tested in IntelliJ with the bazel plugin\n\n</p></details>\n\n## Contributing\n\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\n\nAs mentioned above, this plugin for `protoc` serves two purposes:\n\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC service clients for use with [grpc-web](https://github.com/improbable-eng/grpc-web) or [grpc-node](https://github.com/grpc/grpc-node).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\n\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=grpc-web` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=grpc-web:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport {\n  UserServiceClient,\n  GetUserRequest\n} from \"../generated/users_pb_service\";\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => {\n  /* ... */\n});\n```\n\n### Generating gRPC Service Stubs for use with grpc-node\n\nThis plugin can generate `.d.ts` files for gRPC service definitions as required by [grpc-node](https://github.com/grpc/grpc-node).\n\nTo generate these declaration files from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=grpc-node` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Path to the grpc_node_plugin\nPROTOC_GEN_GRPC_PATH=\"./node_modules/.bin/grpc_tools_node_protoc_plugin\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --plugin=protoc-gen-grpc=${PROTOC_GEN_GRPC_PATH} \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=grpc-node:${OUT_DIR}\" \\\n    --grpc_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `_grpc_pb.js` and `_grpc_pb.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** This plugin does not generate the `_grpc_pb.js` files itself; those are generated by the protoc-gen-grpc plugin. This plugin only generates the `_grpc_pb.d.ts` files.\n\n\n## Examples\n\n- [Example output](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples) -- Code generated by `ts-protoc-gen`.\n- [Packaging the output as a node module](https://github.com/improbable-eng/ts-protoc-gen/issues/173) -- Example of how to use the generated code as a dependendecy of another module.\n\n## Gotchas\n\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.10.1-pre.252fec7","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-8goWvlzhWGWyGUbx49U11WhsFlNaB9o2ywX3O0T9WgTywDREUgBv87W4mb6sFv8w8AtrBs0r3TxNivBIy+jdSQ==","shasum":"22bfd16efaf0de39dd89de0503503e84fadc3b83","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.10.1-pre.252fec7.tgz","fileCount":87,"unpackedSize":321529,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdaLluCRA9TVsSAnZWagAAfnoP/j94VfpyiyfjWQOKAGIH\nZ1NJTl9UP/ZL7Ltt8YOQ1JWeV2RvzTAgsP20z9d2BtJxfynH0WTi57Z64Ish\nnfHvFCQa7H7sGZGLHI6q6+/uuzNM4hPiWAOZbi1Uhw5t8PFqlbB5XUa5k9Ms\nyC3n0XM3+ghkpIYq/IsfL1KxFrJoETEfEW766msdMbkyMrVnyHT6YaY3xEvE\nfGxx5E0yzOUdgE1pERJRl6TvEySaI0/p5qVDo57YhQpWFJ2OoygtBGmpAWNa\nusyaGNaJeviieq6S0/pCqdcmmtY2IRqixJiKYbT7xII+8KfW00jyCOzMs4wK\nLwJZOveN3ik+gk2aUB7u1EhoUo4J/88famxqqUmthuW1rFAcm+NPxgFTxRDk\nSHWqKnikK5zNc2arW4bsmjgphSZvYdMPNk1EG6C/4TS4Z8v+NbX0fLJKrp49\nKLJZUwN8KghSyIMKGVcQbgJY5T6DKBpUIObWXOE+4Gte4uoOiVbDD9OkJOGP\nZShk4Tw8ld0uZOflF+AYPu+RMKbOmMHPNukWQoq7G/VKPKLyHFAJ544OYaNw\ntFB7rUZETS81ih6qIsXomCXY6maKnrac5gHM+hYhq9HWaHvRYESks8j6wmp1\nA4H1JIw/OE/c31e6nalKlvf0eCsE3E6bHz92varFxsgmd4cH27adfwLcGUFP\nnyq2\r\n=9i5f\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIELQ/th3836AQlMLUr9HdS6+UTc/wyBMt1dzbzXrUOmVAiEA9U57dxHwM1IZhLmArAmz761szyeePPEBywWdAetqtgU="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.10.1-pre.252fec7_1567144301491_0.0351759697333085"},"_hasShrinkwrap":false},"0.10.1-pre.49c229b":{"name":"ts-protoc-gen","version":"0.10.1-pre.49c229b","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json \"test/**/*.ts\" \"src/**/*.ts\"","lint:fix":"npm run lint -- --fix","clean":"rimraf lib","build":"run-s clean tsc","generate":"node generate.js","tsc":"tsc","test":"run-s test:unit test:integration","test:unit":"node test/mocha-run-suite.js \"test/unit/**/*.ts\"","test:integration":"node test/mocha-run-suite.js \"test/integration/**/*.ts\"","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@bazel/hide-bazel-files":"~0.33.1","@bazel/jasmine":"~0.33.1","@bazel/karma":"~0.33.1","@bazel/typescript":"~0.33.1","@improbable-eng/grpc-web":"^0.9.1","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/jasmine":"^2.8.9","@types/lodash":"^4.14.106","@types/minimist":"^1.2.0","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","download-cli":"^1.1.1","glob":"^7.1.4","grpc":"^1.22.2","grpc-tools":"^1.8.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","minimist":"^1.2.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","npm-run-all":"^4.1.5","rimraf":"^2.6.3","source-map-support":"^0.4.18","ts-node":"^8.3.0","tsickle":"0.33.1","tslint":"^5.9.1","tsutils":"2.27.2","typescript":"~3.1.6"},"gitHead":"126f99765c600e89989809f3530dc0de709ad3c1","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations\n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web), and as `.d.ts` files in the structure required by [grpc-node](https://github.com/grpc/grpc-node).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\n\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n\n<details><summary>Instructions for using ts-protoc-gen within a <a href=\"https://bazel.build\">bazel</a> build environment</summary><p>\n\nPrerequisites:\n- Setup [rules_nodejs](https://github.com/bazelbuild/rules_nodejs) in your project\n\nThen, include the following in your `WORKSPACE`:\n\n```python\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n\n# NOTE: Setup rules_nodejs\n\nhttp_archive(\n    name = \"ts_protoc_gen\",\n    # NOTE: Update these values to the latest version\n    sha256 = \"355bd8e7a3d4889a3fb222366ac3427229acc968455670378f8ffe1b4bfc5a95\",\n    strip_prefix = \"ts-protoc-gen-14d69f6203c291f15017a8c0abbb1d4b52b00b64\",\n    urls = [\"https://github.com/improbable-eng/ts-protoc-gen/archive/14d69f6203c291f15017a8c0abbb1d4b52b00b64.zip\"],\n)\n\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_dependencies\")\n\ntypescript_proto_dependencies()\n```\n\nAlso make sure you have the following in your `package.json`:\n\n```json\n{\n  \"dependencies\": {\n    \"google-protobuf\": \"^3.6.1\",\n    \"@improbable-eng/grpc-web\": \"0.8.0\",\n    \"browser-headers\": \"^0.4.1\"\n  },\n  \"devDependencies\": {\n    \"@bazel/karma\": \"0.27.8\",\n    \"@bazel/typescript\": \"^0.27.7\",\n    \"@types/google-protobuf\": \"^3.2.7\",\n    \"typescript\": \"^3.1.1\"\n  }\n}\n```\n\n> Run `yarn install` to generate the `yarn.lock` file.\n\nFinally, in your `BUILD.bazel`:\n\n```python\nload(\"@ts_protoc_gen//:defs.bzl\", \"typescript_proto_library\")\n\nproto_library(\n  name = \"test_proto\",\n  srcs = [\n    \"test.proto\",\n  ],\n)\n\ntypescript_proto_library(\n  name = \"test_ts_proto\",\n  proto = \":test_proto\",\n)\n```\n\nYou can use the `test_ts_proto` as a `dep` in other `ts_library` targets. However, you will need to\ninclude `google-protobuf`, `@improbable-eng/grpc-web`, and `browser-headers` at runtime yourself. See\n`//test/bazel:pizza_service_proto_test_suite` for an example.\n\n#### IDE Code Completion\nIf you'd like to get code completion working for the generated protos in your IDE, add the following to your `tsconfig.json`:\n\n```\n{\n  \"compilerOptions\": {\n    \"baseUrl\": \".\",\n    \"paths\": {\n      # Replace <workspace-name> with the name of your workspace\n      \"<workspace-name>/*\": [\n        \"*\", # Enables absolute paths for src files in your project\n        \"bazel-bin/*\" # Enables referencing generate protos with absolute paths\n      ]\n    }\n  }\n}\n```\n\n> NOTE: This has only been tested in IntelliJ with the bazel plugin\n\n</p></details>\n\n## Contributing\n\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\n\nAs mentioned above, this plugin for `protoc` serves two purposes:\n\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC service clients for use with [grpc-web](https://github.com/improbable-eng/grpc-web) or [grpc-node](https://github.com/grpc/grpc-node).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\n\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=grpc-web` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=grpc-web:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport {\n  UserServiceClient,\n  GetUserRequest\n} from \"../generated/users_pb_service\";\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => {\n  /* ... */\n});\n```\n\n### Generating gRPC Service Stubs for use with grpc-node\n\nThis plugin can generate `.d.ts` files for gRPC service definitions as required by [grpc-node](https://github.com/grpc/grpc-node).\n\nTo generate these declaration files from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=grpc-node` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Path to the grpc_node_plugin\nPROTOC_GEN_GRPC_PATH=\"./node_modules/.bin/grpc_tools_node_protoc_plugin\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --plugin=protoc-gen-grpc=${PROTOC_GEN_GRPC_PATH} \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=grpc-node:${OUT_DIR}\" \\\n    --grpc_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `_grpc_pb.js` and `_grpc_pb.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** This plugin does not generate the `_grpc_pb.js` files itself; those are generated by the protoc-gen-grpc plugin. This plugin only generates the `_grpc_pb.d.ts` files.\n\n\n## Examples\n\n- [Example output](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples) -- Code generated by `ts-protoc-gen`.\n- [Packaging the output as a node module](https://github.com/improbable-eng/ts-protoc-gen/issues/173) -- Example of how to use the generated code as a dependendecy of another module.\n\n## Gotchas\n\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.10.1-pre.49c229b","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-csQfgvfEvORN2t6JU+BDEHqjTrMNMGrKCPU45WA2RN4ZTOBDS0Z6xeW7l5gfmBrH4+/321g4R4B0wh9hvk3WZQ==","shasum":"697847dc49ae8d759d1466319a952382ca15ab11","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.10.1-pre.49c229b.tgz","fileCount":87,"unpackedSize":322350,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdaNJnCRA9TVsSAnZWagAAHPYQAIwGuaZ/j4nbW+8oCtUH\nWHSbqgpiXqsocJuKdi2fYwhsJGA1jWcaG8Yw8AReU+W3U1o3XP7OF3agUM5n\nOg9uvqWsa/ql5W+7mS7jpnRgdVSEPwqap5bxKLlTvGmK0/w1zpwIGbQrr8B3\nMnFrOL0+1GEC28KE24lfxYnaw/4QbYnDf+wf7+4axEKHtSQzMY01JOGxJ3Co\nSnwcCR/8AmReEOwp4NuTxEd4z7XM5akXAmcMPf8XniOIf6qxQEkDW+misfcq\nAgWTaSuYcZ+oTBLiZjcEi/wFAeAtfRYXFwm5mvpOnuGZrz2DSfKOMwn4js+v\n5KaDUJyNwxTqI2F4goWMNFCpPrI55YNSa5d6GdeHMzvb0T+Utfnw+gzk/m4i\nesARO54ltka3JVQXrRJnJhTEkiLycbScJ5CPkICdiXLwZ2N2vtrAnfnyfzA4\nd+PVeMNS9EheIgyOaCefeJ84Ju/aah37wbsqhASObIKkX/LWxiVQHWtnNHY1\nlXJwwK9odd1geOq6D6Y9cYUPrNOlWKANon5xX+8fawgeTz6PaD1LRnuwjyWE\neGWGduSH2sRD4/EpECw7j6WS01kZP6LxdgvL1dJQXVeDYxenka71mR7UvgDz\n3fjnJdErNcIktS1dA4caUh1iQIP0fOe58BFlMkAZSF2RqidYFKKGVcTaZMFr\nRxnG\r\n=iRXa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQOBpTgWGG37I5nLmk2ClTtWl3B+06Yov26bu/4lI0SQIhAL1wH9IUtndp6AbkYW5C9JKR+djMl5Pj4Y2gUC7qECnH"}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.10.1-pre.49c229b_1567150694880_0.9784464368073951"},"_hasShrinkwrap":false},"0.11.0":{"name":"ts-protoc-gen","version":"0.11.0","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json \"test/**/*.ts\" \"src/**/*.ts\"","lint:fix":"npm run lint -- --fix","clean":"rimraf lib","build":"run-s clean tsc","generate":"node generate.js","tsc":"tsc","test":"run-s test:unit test:integration","test:unit":"node test/mocha-run-suite.js \"test/unit/**/*.ts\"","test:integration":"node test/mocha-run-suite.js \"test/integration/**/*.ts\"","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@bazel/hide-bazel-files":"~0.33.1","@bazel/jasmine":"~0.33.1","@bazel/karma":"~0.33.1","@bazel/typescript":"~0.33.1","@improbable-eng/grpc-web":"^0.9.1","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/jasmine":"^2.8.9","@types/lodash":"^4.14.106","@types/minimist":"^1.2.0","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","download-cli":"^1.1.1","glob":"^7.1.4","grpc":"^1.22.2","grpc-tools":"^1.8.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","minimist":"^1.2.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","npm-run-all":"^4.1.5","rimraf":"^2.6.3","source-map-support":"^0.4.18","ts-node":"^8.3.0","tsickle":"0.33.1","tslint":"^5.9.1","tsutils":"2.27.2","typescript":"~3.1.6"},"gitHead":"3de192dcb347c0e219006104a18d3218aad6fc00","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.11.0","_npmVersion":"6.4.1","_nodeVersion":"10.15.0","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-A/TbXf7JpHGj+bfQaR8H7qfoYC8jS8OQoWBRUVSFvJspg2UFHDkuAtLne3fxXzAAQL/qUofINjZpLAOhVkKMtg==","shasum":"6a31755321c0d0f4563ce7bcdb8b72a2c9a7c458","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.11.0.tgz","fileCount":87,"unpackedSize":322338,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdaPFDCRA9TVsSAnZWagAAREAP/0FKSXJHpKrLRGuOZDS4\n3tqXRa2yZAO422SntU6W6epDyxcdrUx3jIm4Xxa5nnNWRwHe8QA5JWLyj3Aw\n4W8+7/OzFai0beRS257wHfsGWa5JHxcIOSvZV3jsu6bv/1Xvp7y1oHqd15ch\nUVtAh5A8bSof1aknv07vEJu4UcNTXxtWHru9Tvp/y0sblAnpIfsMVEeT6o9g\nJz39xcUJWsQxu5puOCaEdl2ZivPec3fMwqezOofv0ZfvVJLIfmy2rOz9gjNL\nWT6TduJuY/Wx/9IM+eom1U760utP09E09N9OOJMEUaGc4uKmypmze5LdTxjC\nG0JB1LaVOLpo+sCe6Ap/87pAra0iynqqNcvEfhJOjbxeNwHYAUObq2DGZ+aQ\nNqGj27JyU9E4TC03jh+ZZNBwtYY48M0QHzKtaeVpjlNY0AJaJh2MQc8j0AYD\nLMmPkcLKIKEVKyJj66dYpIWFY65hYJ3/wTn+9Xh2dLAvgq3zooSedihT5uPT\nSN7qqMHossqPyaln9R0qQfKWibpfftr/2vJ9stOGCpX3UlYpwR6QS8sV41nc\ne7rLny2hAOh6+V3QBleTjVxv6l5q+ahRyRGhybx6uSjxmrBjkh2FTT5Q3Hct\njREtptKz/VkDb38KEmbdqmAyARAvueFK5g+GUfT4qW7acD0yEOPxDW0SJo+d\notau\r\n=EbGY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBDqT+PcKtK7AZ5kEw9LzWQ9gw4ISkrreWOkWJ7lxV25AiEAvNOiMaN1pdWMSDo158WeI00RCPEVpH3LVc9aLmzFusg="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.11.0_1567158594598_0.5646873871550226"},"_hasShrinkwrap":false},"0.11.1-pre.dc70c35":{"name":"ts-protoc-gen","version":"0.11.1-pre.dc70c35","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json \"test/**/*.ts\" \"src/**/*.ts\"","lint:fix":"npm run lint -- --fix","clean":"rimraf lib","build":"run-s clean tsc","generate":"node generate.js","tsc":"tsc","test":"run-s test:unit test:integration","test:unit":"node test/mocha-run-suite.js \"test/unit/**/*.ts\"","test:integration":"node test/mocha-run-suite.js \"test/integration/**/*.ts\"","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@improbable-eng/grpc-web":"^0.9.1","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","download-cli":"^1.1.1","glob":"^7.1.4","grpc":"^1.22.2","grpc-tools":"^1.8.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","npm-run-all":"^4.1.5","rimraf":"^2.6.3","source-map-support":"^0.4.18","ts-node":"^8.3.0","tslint":"^5.9.1","tsutils":"2.27.2","typescript":"~3.1.6"},"gitHead":"fefd7a0fce46d938f7b2296f5a28ead40f86a3f3","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations\n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web), and as `.d.ts` files in the structure required by [grpc-node](https://github.com/grpc/grpc-node).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\n\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n\nThe bazel rules have been moved to a separate project [here](https://github.com/Dig-Doug/rules_typescript_proto).\nThere is a\n[migration guide](https://github.com/Dig-Doug/rules_typescript_proto/blob/master/docs/migrating_from_ts_protoc_gen.md)\nfor existing users.\n\n## Contributing\n\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\n\nAs mentioned above, this plugin for `protoc` serves two purposes:\n\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC service clients for use with [grpc-web](https://github.com/improbable-eng/grpc-web) or [grpc-node](https://github.com/grpc/grpc-node).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\n\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=grpc-web` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=grpc-web:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport {\n  UserServiceClient,\n  GetUserRequest\n} from \"../generated/users_pb_service\";\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => {\n  /* ... */\n});\n```\n\n### Generating gRPC Service Stubs for use with grpc-node\n\nThis plugin can generate `.d.ts` files for gRPC service definitions as required by [grpc-node](https://github.com/grpc/grpc-node).\n\nTo generate these declaration files from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=grpc-node` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Path to the grpc_node_plugin\nPROTOC_GEN_GRPC_PATH=\"./node_modules/.bin/grpc_tools_node_protoc_plugin\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --plugin=protoc-gen-grpc=${PROTOC_GEN_GRPC_PATH} \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=grpc-node:${OUT_DIR}\" \\\n    --grpc_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `_grpc_pb.js` and `_grpc_pb.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** This plugin does not generate the `_grpc_pb.js` files itself; those are generated by the protoc-gen-grpc plugin. This plugin only generates the `_grpc_pb.d.ts` files.\n\n\n## Examples\n\n- [Example output](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples) -- Code generated by `ts-protoc-gen`.\n- [Packaging the output as a node module](https://github.com/improbable-eng/ts-protoc-gen/issues/173) -- Example of how to use the generated code as a dependendecy of another module.\n\n## Gotchas\n\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.11.1-pre.dc70c35","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-Qr8xyqG8JXbJsrmGKnbqxTuU8EEOobNq6BnpDC1hWUqdW/1AxXTw+6yfkVKLvx155/OxKRtGt/vCH7wsiDMCcw==","shasum":"cc10995e304c1cc6de0b4c8f21707409a1e3df5f","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.11.1-pre.dc70c35.tgz","fileCount":79,"unpackedSize":161229,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdrsHNCRA9TVsSAnZWagAAaQIP/2OZ9i9hMwcoFGeW7CJz\nNoQGAOUF8kLuMT0N6pDLsGW4Av4sbKKJRv+MqZjBHSw50xaBtUWX6yaS96M+\nfDV7THCe+3ZMFeCCt6BJ5LpAygfKrEgIZnp20zEUVOw0PbDHjt5W+sM10Z4D\nK04Du1TbTCD+NmlTQCerNkEHRLFWPYg1cWu6+KXgicEzgAgouRhnGrTT1pfv\npkHRNl96ptOSC5aWUsmDgiuWFu+hzRtasyejrP2q9N9fuAlX2adC4to1dWh8\nrW/sBO+niU3kSERQRd8NgI797x4xnZfjZtHo36DWqVb8H2x9SAp0V1W/OY1a\nI4MU0C/0orln6TYKOSQUQex9K3wejki14CQBfTr+Xro+eNwZRgjXSF31hDBI\nRqsit9KFiF/SNGGX1LGnkhqAHPRw3WfvGQZjxP/+Yb5WepGG2+XOV3yvShxy\nsLedNc4EJSOQnuuH/vq0/MsK/JptgNRTrALNrDI8PUsYNVlFf+Jgk+UkPYfy\n/ca6UnWD3hswY5dFHRgxj2e1xIVx2juASKx+wHUP+zbWj4I0ntF6pkN7k5aZ\nUHhkGbM/l0XkPAztrGJlqsw4eLv5+/c0+1SiqaenjRIHlYC1MjjuH/OqBpfv\nj4xGztrF9dKyE/8tXGFUjX2HiMGqIN3N6FU0DjN+TP+XTQacGVk1Cb+9oNGy\nd1iX\r\n=+rMH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFKODpvrSnxkJKfRrbja/31E8gG3djVTFrtmnQDkTVk8AiEA8Qug+PMPfnG1Xnn1sMNWtCzldtEvgBcaSzp+wqWour0="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.11.1-pre.dc70c35_1571733965039_0.5509100276895551"},"_hasShrinkwrap":false},"0.12.0":{"name":"ts-protoc-gen","version":"0.12.0","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json \"test/**/*.ts\" \"src/**/*.ts\"","lint:fix":"npm run lint -- --fix","clean":"rimraf lib","build":"run-s clean tsc","generate":"node generate.js","tsc":"tsc","test":"run-s test:unit test:integration","test:unit":"node test/mocha-run-suite.js \"test/unit/**/*.ts\"","test:integration":"node test/mocha-run-suite.js \"test/integration/**/*.ts\"","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@improbable-eng/grpc-web":"^0.9.1","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","download-cli":"^1.1.1","glob":"^7.1.4","grpc":"^1.22.2","grpc-tools":"^1.8.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","npm-run-all":"^4.1.5","rimraf":"^2.6.3","source-map-support":"^0.4.18","ts-node":"^8.3.0","tslint":"^5.9.1","tsutils":"2.27.2","typescript":"~3.1.6"},"gitHead":"140c0c46bc58fd9832d94bdb7a5a2de545bd915d","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.12.0","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-V7jnICJxKqalBrnJSMTW5tB9sGi48gOC325bfcM7TDNUItVOlaMM//rQmuo49ybipk/SyJTnWXgtJnhHCevNJw==","shasum":"932e5738f14b67e7202825b06f8c548cb7d8ef34","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.12.0.tgz","fileCount":79,"unpackedSize":161402,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdr1tiCRA9TVsSAnZWagAA0TcP/1lMwab0P0wo8iFgwwPx\nOS/fHALZSnYip8SsbZAYFSvWHdx3vq55thitglA/+avw+Xx/wFoBVLguF6HT\npASgtoJrmivkhAT1mr0lvkjI5lGdYDXsAnqZ8VhORjmtcRxINu15iJDIaBQm\nvnRskaX/WHgvYzD8r3LPNcMp+js7olzU+TLQh0JA3VW0GmvuBmWYchTEaobE\nL1BLV5MLxv9d72zrsVjx+M9OQon7mzW06STELpDyQI8TOYm1++IPoOPoBGVY\nTmXIw1Hb8yCXFYqw8OJrprycXezoX+/VcNbyDj1TSbm51VqSt81+8yKGwTbV\n9yMCcPlSOrM6NHZVMOC4tL7a006N1jKL+T+3VfQlo0tlCujp3+FKj1KD23yN\nNv0zYxocPaukP+SJmYF5TZ7FGrFKdpIG6iaMFQ1TYVY0XPzKsle2wx3BWl1z\nTdmmpx5hTIypPFvQWxN+kALmADPkZVnRJxW9RCacNEU/j5haVOt75IcR13gX\nw4LMOglM5aM3K2eWpHuY44ECjxXHSyNpUy284HHJm9Qs5azo/mtqwDgUn907\nITsp+qFtIlQtpEHMMJCyDjzlGSKfphJUkU0xz3tj0jn3YTy4lkDEWv3/k+SN\n+iZ7Vsahjv5zIkzzePWsWR3QqzhcqDFE3OlvkMLodDt2x+XXQXfn/RVlDgDI\nI5T5\r\n=i3Y6\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDpF4PVn4yFy9ox8mlrUYobSq/xO1p/pJCcssg0b2U11AiB7aWkFKNzdKk3o35J2O6YPjZNKgQD3Td7mwP7cR8k8eQ=="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.12.0_1571773281649_0.6609476591008847"},"_hasShrinkwrap":false},"0.12.1-pre.46e6630":{"name":"ts-protoc-gen","version":"0.12.1-pre.46e6630","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json \"test/**/*.ts\" \"src/**/*.ts\"","lint:fix":"npm run lint -- --fix","clean":"rimraf lib","build":"run-s clean tsc","generate":"node generate.js","tsc":"tsc","test":"run-s test:unit test:integration","test:unit":"node test/mocha-run-suite.js \"test/unit/**/*.ts\"","test:integration":"node test/mocha-run-suite.js \"test/integration/**/*.ts\"","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@improbable-eng/grpc-web":"^0.9.1","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","download-cli":"^1.1.1","glob":"^7.1.4","grpc":"^1.22.2","grpc-tools":"^1.8.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","npm-run-all":"^4.1.5","rimraf":"^2.6.3","source-map-support":"^0.4.18","ts-node":"^8.3.0","tslint":"^5.9.1","tsutils":"2.27.2","typescript":"~3.1.6"},"gitHead":"67a497059ba488c96b66af9090abe54261b83927","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations\n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web), and as `.d.ts` files in the structure required by [grpc-node](https://github.com/grpc/grpc-node).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\n\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n\nThe bazel rules have been moved to a separate project [here](https://github.com/Dig-Doug/rules_typescript_proto).\nThere is a\n[migration guide](https://github.com/Dig-Doug/rules_typescript_proto/blob/master/docs/migrating_from_ts_protoc_gen.md)\nfor existing users.\n\n## Contributing\n\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\n\nAs mentioned above, this plugin for `protoc` serves two purposes:\n\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC service clients for use with [grpc-web](https://github.com/improbable-eng/grpc-web) or [grpc-node](https://github.com/grpc/grpc-node).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\n\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=grpc-web` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=grpc-web:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport {\n  UserServiceClient,\n  GetUserRequest\n} from \"../generated/users_pb_service\";\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => {\n  /* ... */\n});\n```\n\n### Generating gRPC Service Stubs for use with grpc-node\n\nThis plugin can generate `.d.ts` files for gRPC service definitions as required by [grpc-node](https://github.com/grpc/grpc-node).\n\nTo generate these declaration files from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=grpc-node` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Path to the grpc_node_plugin\nPROTOC_GEN_GRPC_PATH=\"./node_modules/.bin/grpc_tools_node_protoc_plugin\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --plugin=protoc-gen-grpc=${PROTOC_GEN_GRPC_PATH} \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=grpc-node:${OUT_DIR}\" \\\n    --grpc_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `_grpc_pb.js` and `_grpc_pb.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** This plugin does not generate the `_grpc_pb.js` files itself; those are generated by the protoc-gen-grpc plugin. This plugin only generates the `_grpc_pb.d.ts` files.\n\n\n## Examples\n\n- [Example output](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples) -- Code generated by `ts-protoc-gen`.\n- [Packaging the output as a node module](https://github.com/improbable-eng/ts-protoc-gen/issues/173) -- Example of how to use the generated code as a dependendecy of another module.\n\n## Gotchas\n\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.12.1-pre.46e6630","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"dist":{"integrity":"sha512-Fj6rgpa0Niqkzi7iY08KcntmZ9ZKxMUskeFO2Tp8NxLnTxek4JRzygIxQGgiNMmBZy7f/SYV5pyNtInkxK2YWw==","shasum":"23af315437739b891edc3b822c932f14ebeb77ac","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.12.1-pre.46e6630.tgz","fileCount":79,"unpackedSize":161429,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdr1twCRA9TVsSAnZWagAAKzUP/As/5GnUbMTVP7Lqacvy\nMTxTRwgVse9rwRctSKf6zPBBqSthArAjP40xJ71mij4HXlC+baXDBVMS6f7r\nVZ3BDqcmNTxASuG+N7Avet2LrJLA9vKTX9s9vPfJNHG7164vLXD9QvVL7y96\nh5m4938PJ/7/p3sgq7rabYKygVA7N36mI7kPWpzLSkJfcIFvndU6pfMEYOBb\nVZ/7zo5vZV9TGEk24l3l4oN7DGUPZbTbpwdUgANhKWPhFaf/A9ZhvhHy72Zg\nCQTaYCC9SrrSNLpTfrIX1E/ute7Gs139hS9L0p3ngJANUoxycWcSgaGk0ria\n1kLcP1A7f9ISOT8tXYUc/QIUufkGcWKGlMMFTs2Gx8+9HtX/cSuYh8SnjCZc\n+EQ6Q6se8GVLlIKm31uQnPSR6RHcfEK4AROOR1N6uoZVnuq7UqIAMS+Vfax7\nozz3meMIWwt+IpE7Pwt2MMVRpoHpB+GEJZ8x3NYp4V/Ez42NINY+CLe7Eefk\nPW/h5Luffvm5ijkXIxpy59/XxaG1joUycwTO5vTPmY87MgDGnJMGYzsdnHz6\nvjLLP7qbjjijbqOmY1ZMHco62msZ8TYrLvcfQCeDNZ6etR1gbZCybO1WBNoH\nDWWN2RWFr+TRHbxuVa0UfPTLgDIvicWuh6G8BSli+k5ujwHPxvN5qXfjZMvl\nz75g\r\n=HLXp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCsANHOLXtBA7QIfm4DvUFmzpLKmgbSyApDQL+9cSzVAwIhAOaKjciqurb4XRKRElPASa23kGw35iP8iWGhgse2h/aZ"}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.12.1-pre.46e6630_1571773296081_0.4990554810810577"},"_hasShrinkwrap":false},"0.12.1-pre.a78a914":{"name":"ts-protoc-gen","version":"0.12.1-pre.a78a914","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json \"test/**/*.ts\" \"src/**/*.ts\"","lint:fix":"npm run lint -- --fix","clean":"rimraf lib","build":"run-s clean tsc","generate":"node generate.js","tsc":"tsc","test":"run-s test:unit test:integration","test:unit":"node test/mocha-run-suite.js \"test/unit/**/*.ts\"","test:integration":"node test/mocha-run-suite.js \"test/integration/**/*.ts\"","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@improbable-eng/grpc-web":"^0.9.1","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","download-cli":"^1.1.1","glob":"^7.1.4","grpc":"^1.22.2","grpc-tools":"^1.8.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","npm-run-all":"^4.1.5","rimraf":"^2.6.3","source-map-support":"^0.4.18","ts-node":"^8.3.0","tslint":"^5.9.1","tsutils":"2.27.2","typescript":"~3.1.6"},"gitHead":"eeb6b845e60f6485998dcf4e01eaafe5680cd8f3","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations\n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web), and as `.d.ts` files in the structure required by [grpc-node](https://github.com/grpc/grpc-node).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\n\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n\nThe bazel rules have been moved to a separate project [here](https://github.com/Dig-Doug/rules_typescript_proto).\nThere is a\n[migration guide](https://github.com/Dig-Doug/rules_typescript_proto/blob/master/docs/migrating_from_ts_protoc_gen.md)\nfor existing users.\n\n## Contributing\n\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\n\nAs mentioned above, this plugin for `protoc` serves two purposes:\n\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC service clients for use with [grpc-web](https://github.com/improbable-eng/grpc-web) or [grpc-node](https://github.com/grpc/grpc-node).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\n\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=grpc-web` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=grpc-web:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport {\n  UserServiceClient,\n  GetUserRequest\n} from \"../generated/users_pb_service\";\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => {\n  /* ... */\n});\n```\n\n### Generating gRPC Service Stubs for use with grpc-node\n\nThis plugin can generate `.d.ts` files for gRPC service definitions as required by [grpc-node](https://github.com/grpc/grpc-node).\n\nTo generate these declaration files from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=grpc-node` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Path to the grpc_node_plugin\nPROTOC_GEN_GRPC_PATH=\"./node_modules/.bin/grpc_tools_node_protoc_plugin\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --plugin=protoc-gen-grpc=${PROTOC_GEN_GRPC_PATH} \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=grpc-node:${OUT_DIR}\" \\\n    --grpc_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `_grpc_pb.js` and `_grpc_pb.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** This plugin does not generate the `_grpc_pb.js` files itself; those are generated by the protoc-gen-grpc plugin. This plugin only generates the `_grpc_pb.d.ts` files.\n\n\n## Examples\n\n- [Example output](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples) -- Code generated by `ts-protoc-gen`.\n- [Packaging the output as a node module](https://github.com/improbable-eng/ts-protoc-gen/issues/173) -- Example of how to use the generated code as a dependendecy of another module.\n\n## Gotchas\n\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.12.1-pre.a78a914","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-0xS+OskEgHGrluq4fGryXmqOFtrPJ53bO+0BG3RsfYw+tTxwSQnKfOkFQJwPWXoC3pOcZqv7aQyGa8c3gMjUeQ==","shasum":"ab118ae7dda3f94d8f93259f340ed74fb7d3b1e4","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.12.1-pre.a78a914.tgz","fileCount":79,"unpackedSize":161429,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdr1z+CRA9TVsSAnZWagAAtdgP/1r7huGY6N4woReNgHM7\ndi9L1hWKFigglSDByZdywNLS7bZGT4qBj91GTTlsnuEH13jI0VACjFnResdA\nFsTAQVWlg5G1ED0v2z1QOnWI2Z6lQITE4Huk7sP6QLYrR2T6fmVS7tXMXRHQ\n+NLD+CFozrrNgX1GB7LYkPtHAOaB2Q4UX2g7e4KFSCu4xn9hZ8z7D7/Pn3TX\nYOmJKaelgM/fE7a9dU3D0FksXm6kOfQFIumAkUaW/faqSKf2k8u3aLVXKrjx\nPQXHuWhTDKsPVzZHiS5VzfWFQo74FXGUVeE7TYkj41T9z+P7jkIq1oVuYLnC\nFqsyQ4ZXpZm2e05dmjp3DLIuV3ZIiRN7A+h41zZ7v0vXiVQvO1UB1QLugG+H\nscwnq6lbTeFRDKSiakXvVWUdFfbG9DJ5t4h5fUkKWvLIEkPu+bCIyETvbkWY\nJDXrDEpFpJIf5haDYIJaSFlLnaH8hx/1dauVj2YZhhBa3ew9Dr0gTFuS9oay\ntpv2P8DHqZ4jMfkMVvEfWokHyfJTYTozeZS094+HRXtqNgo0N1qqQ7FuduAg\nWmqjc586PadtbvZXleAaA9/+R3TEMsyEBsBUPEFkDeAzyHQTiW4cQIqxdvPw\n/N3ZRhsAXICQkZbfoCzO5Njr9DnsNZc+i0XM4ot8t7JR2oYFnF8iRS/D4pss\nb30I\r\n=BImL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFAVZUzenICLz8d8DocoUr9NxdozVZtfXyHXaWdcLiDgAiB+iKur28bem8H5Hy4F5pzLFkNDQEJtBJWTO7y1x97uAw=="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.12.1-pre.a78a914_1571773693706_0.64170382238864"},"_hasShrinkwrap":false},"0.12.1-pre.abb949e":{"name":"ts-protoc-gen","version":"0.12.1-pre.abb949e","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json \"test/**/*.ts\" \"src/**/*.ts\"","lint:fix":"npm run lint -- --fix","clean":"rimraf lib","build":"run-s clean tsc","generate":"node generate.js","tsc":"tsc","test":"run-s test:unit test:integration","test:unit":"node test/mocha-run-suite.js \"test/unit/**/*.ts\"","test:integration":"node test/mocha-run-suite.js \"test/integration/**/*.ts\"","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@improbable-eng/grpc-web":"^0.9.1","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","download-cli":"^1.1.1","glob":"^7.1.4","grpc":"^1.22.2","grpc-tools":"^1.8.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","npm-run-all":"^4.1.5","rimraf":"^2.6.3","source-map-support":"^0.4.18","ts-node":"^8.3.0","tslint":"^5.9.1","tsutils":"2.27.2","typescript":"~3.1.6"},"gitHead":"fa673512282132ee4b50971b8b7161d8db381747","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations\n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web), and as `.d.ts` files in the structure required by [grpc-node](https://github.com/grpc/grpc-node).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\n\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n\nThe bazel rules have been moved to a separate project [here](https://github.com/Dig-Doug/rules_typescript_proto).\nThere is a\n[migration guide](https://github.com/Dig-Doug/rules_typescript_proto/blob/master/docs/migrating_from_ts_protoc_gen.md)\nfor existing users.\n\n## Contributing\n\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\n\nAs mentioned above, this plugin for `protoc` serves two purposes:\n\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC service clients for use with [grpc-web](https://github.com/improbable-eng/grpc-web) or [grpc-node](https://github.com/grpc/grpc-node).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\n\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=grpc-web` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=grpc-web:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport {\n  UserServiceClient,\n  GetUserRequest\n} from \"../generated/users_pb_service\";\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => {\n  /* ... */\n});\n```\n\n### Generating gRPC Service Stubs for use with grpc-node\n\nThis plugin can generate `.d.ts` files for gRPC service definitions as required by [grpc-node](https://github.com/grpc/grpc-node).\n\nTo generate these declaration files from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=grpc-node` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Path to the grpc_node_plugin\nPROTOC_GEN_GRPC_PATH=\"./node_modules/.bin/grpc_tools_node_protoc_plugin\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --plugin=protoc-gen-grpc=${PROTOC_GEN_GRPC_PATH} \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=grpc-node:${OUT_DIR}\" \\\n    --grpc_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `_grpc_pb.js` and `_grpc_pb.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** This plugin does not generate the `_grpc_pb.js` files itself; those are generated by the protoc-gen-grpc plugin. This plugin only generates the `_grpc_pb.d.ts` files.\n\n\n## Examples\n\n- [Example output](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples) -- Code generated by `ts-protoc-gen`.\n- [Packaging the output as a node module](https://github.com/improbable-eng/ts-protoc-gen/issues/173) -- Example of how to use the generated code as a dependendecy of another module.\n\n## Gotchas\n\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.12.1-pre.abb949e","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-BD/g9sHTIX2krSmyR7NxYJt1q0kAB9EOHFe0mlc4dQQ5LKGfFYh+Ox8lBgpxeYpA4q2OtY3Pg+az4RfPLpuOxg==","shasum":"33dba3020a2de08a68fcdf95eafc8dfa2048dca1","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.12.1-pre.abb949e.tgz","fileCount":79,"unpackedSize":161429,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezSAfCRA9TVsSAnZWagAA9CIP/0EMJAx76zoz9izv5ZI3\n2ebmn4JVNG2Ksnl/mWcnaAn4cz+zqH5F937NzLQBfCZq6mcNRai0WvOz/CPo\nVtj78kS/ncZAjf05rTXUg+ItiVeCVpJPLOq3reRwu5+qp7ghbph7fQYmsf0s\n908LkZdiwbwpH2XufBAox4m23wHV0xGadQ28wvtq82mZoKrW8xh+Tn6AneW0\nG5SXYQxgyjuy9Xwa5R3ORVmOfyqhlmms7VwnxzmF0FPI6w4cD1gsYUQfqEfx\nNyeKcg5DqKSuhhgowd5RyPFRUS7bVJ862pDBja3emQ9mk730JNPonAonA9cI\npfiSD34Bp03zyBXbnFQWUVQL4MBlOHrCmwx1ii1pTzyhn2LAuA62K0lPs04Y\nqkimsBwYYA9Fp4t92LMUafrXgtex89K9YecmYojTljemI0hgEgw3Y4FwkI34\nnpWbRqF67CFhlMYWqye2X3SkgopZqgr5Ca/udoLtjqOiqFFwwyt/26IjADma\nYhtQ2SaOTbkHdd1e7r6dW2/fnaAo5dWtobdv4DT0Kx49FtDxVJqkb84edi6M\nDE7d4xmDEv92dOtslgU228sYgxa9TWjZDFAEB83TcwsPvWPEi1r29tHL0WJG\n4PRaElq3b2dgTt0TRi99iuE2VV0WL3TDG2c0A3V2JQlMcVQMltDEs+3McIzt\nCzo1\r\n=b3gE\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDGnsE5CvqJ4atNboC1/eOt8R6BHzXYZR5S2pUkdw5/NgIgUrG0bbdelDZvSKUGoBV9uphNWhk1+R9yz91M6yTn1c0="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.12.1-pre.abb949e_1590501407338_0.26117693124702"},"_hasShrinkwrap":false},"0.12.1-pre.3266132":{"name":"ts-protoc-gen","version":"0.12.1-pre.3266132","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json \"test/**/*.ts\" \"src/**/*.ts\"","lint:fix":"npm run lint -- --fix","clean":"rimraf lib","build":"run-s clean tsc","generate":"node generate.js","tsc":"tsc","test":"run-s test:unit test:integration","test:unit":"node test/mocha-run-suite.js \"test/unit/**/*.ts\"","test:integration":"node test/mocha-run-suite.js \"test/integration/**/*.ts\"","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@improbable-eng/grpc-web":"^0.9.1","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","download-cli":"^1.1.1","glob":"^7.1.4","grpc":"^1.24.2","grpc-tools":"^1.8.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","npm-run-all":"^4.1.5","rimraf":"^2.6.3","source-map-support":"^0.4.18","ts-node":"^8.3.0","tslint":"^5.9.1","tsutils":"2.27.2","typescript":"~3.1.6"},"gitHead":"a2ee0abfd00559d7043bc5706b28ba3d2a5ee37e","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations\n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web), and as `.d.ts` files in the structure required by [grpc-node](https://github.com/grpc/grpc-node).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\n\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n\nThe bazel rules have been moved to a separate project [here](https://github.com/Dig-Doug/rules_typescript_proto).\nThere is a\n[migration guide](https://github.com/Dig-Doug/rules_typescript_proto/blob/master/docs/migrating_from_ts_protoc_gen.md)\nfor existing users.\n\n## Contributing\n\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\n\nAs mentioned above, this plugin for `protoc` serves two purposes:\n\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC service clients for use with [grpc-web](https://github.com/improbable-eng/grpc-web) or [grpc-node](https://github.com/grpc/grpc-node).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\n\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=grpc-web` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=grpc-web:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport {\n  UserServiceClient,\n  GetUserRequest\n} from \"../generated/users_pb_service\";\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => {\n  /* ... */\n});\n```\n\n### Generating gRPC Service Stubs for use with grpc-node\n\nThis plugin can generate `.d.ts` files for gRPC service definitions as required by [grpc-node](https://github.com/grpc/grpc-node).\n\nTo generate these declaration files from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=grpc-node` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Path to the grpc_node_plugin\nPROTOC_GEN_GRPC_PATH=\"./node_modules/.bin/grpc_tools_node_protoc_plugin\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --plugin=protoc-gen-grpc=${PROTOC_GEN_GRPC_PATH} \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=grpc-node:${OUT_DIR}\" \\\n    --grpc_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `_grpc_pb.js` and `_grpc_pb.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** This plugin does not generate the `_grpc_pb.js` files itself; those are generated by the protoc-gen-grpc plugin. This plugin only generates the `_grpc_pb.d.ts` files.\n\n\n## Examples\n\n- [Example output](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples) -- Code generated by `ts-protoc-gen`.\n- [Packaging the output as a node module](https://github.com/improbable-eng/ts-protoc-gen/issues/173) -- Example of how to use the generated code as a dependendecy of another module.\n\n## Gotchas\n\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.12.1-pre.3266132","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-sF5VGw4LcFwKIGtGc2GaqK9QxflgBswelkKUPVXcZBkupM+trVEHWRhPP1mEbUhcZtU0zoHdKpRHvrehBU4YWA==","shasum":"49b322818dd3bc51801972a4ce4423fb5d5e6bb8","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.12.1-pre.3266132.tgz","fileCount":79,"unpackedSize":161429,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJezmUgCRA9TVsSAnZWagAAPvsP/1ezx33TU39z7k93BL8M\nBZGeyH+QxXVWXFP0clOkiCOQz5FA/0DxOHr7hFDBdwuaBqeeMJQCztLfkNYv\nh21SQe2nDepG00QwAzWAOJYqLua6uS/JpyR5R9Zn9lAQeJukYxzVRf6JdX+S\nb/4+3U9NK/OJBooeyk7G3l8UzwOWpf1Zj13+HcZBy2rlYzhh5Ul3yQQfDLHc\noL6xn+Iz7QQFTU1UhNrKzDD6yh5WRSNDlbrWlRj6C0D8erJOafoHOVh4Xh3R\n4AKcPq0McTjAwfGycl5dY9uWDxY2oPLgDvPOReDhSYh94FLQVK0Cv5zMVpsD\ngXM3E+MR/A/ajAXASB6R8Lz1Cd4jOnaGHUIaou5yPIYGzoUI/Bro6o1LtVMA\nIxitQQMx7+RMdiN8HoQ4eUh7jSsdaHwBJbWltuekmWYQV6CVYP+zm712TP5B\nmgX2jOXOfRllWO5vgA6SyaXLiUmqvaazgKm39Rl5KzjeCFNeYL6CrCxk6jfU\nfjBEENbvfoWXoA5OkPls3EbUqFEWQuk5UGa/KEI1zfJIGNjwDttsRONKVGz0\n7a8Afl54PGpKTOhX6X+JbVE4qyhkTawWRpoK0cPnpjQYCVWNQCa4QbZhNorM\n/hgaMSZbmjy9PstSKBUmB39zSawbn5r/nORtlj0PW7juRKX2+cp4kZJppo5d\n+F23\r\n=lbES\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAQfscH8+US13oiqejBE4d0yJijbrIb/jFerjq5vyAQUAiBRmid5zLDgBTX9xMlPAnDW81zQhmbudHfd6vjnKW33aQ=="}]},"maintainers":[{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"}],"_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.12.1-pre.3266132_1590584607733_0.5543961178749182"},"_hasShrinkwrap":false},"0.12.1-pre.6383416":{"name":"ts-protoc-gen","version":"0.12.1-pre.6383416","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json \"test/**/*.ts\" \"src/**/*.ts\"","lint:fix":"npm run lint -- --fix","clean":"rimraf lib","build":"run-s clean tsc","generate":"node generate.js","tsc":"tsc","test":"run-s test:unit test:integration","test:unit":"node test/mocha-run-suite.js \"test/unit/**/*.ts\"","test:integration":"node test/mocha-run-suite.js \"test/integration/**/*.ts\"","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@improbable-eng/grpc-web":"^0.9.1","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","download-cli":"^1.1.1","glob":"^7.1.4","grpc":"^1.24.2","grpc-tools":"^1.9.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","npm-run-all":"^4.1.5","rimraf":"^2.6.3","source-map-support":"^0.4.18","ts-node":"^8.3.0","tslint":"^5.9.1","tsutils":"2.27.2","typescript":"~3.1.6"},"gitHead":"e27d115a44670e9ab62b0bc3e98b51ecf5a73bb9","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations\n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web), and as `.d.ts` files in the structure required by [grpc-node](https://github.com/grpc/grpc-node).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\n\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n\nThe bazel rules have been moved to a separate project [here](https://github.com/Dig-Doug/rules_typescript_proto).\nThere is a\n[migration guide](https://github.com/Dig-Doug/rules_typescript_proto/blob/master/docs/migrating_from_ts_protoc_gen.md)\nfor existing users.\n\n## Contributing\n\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\n\nAs mentioned above, this plugin for `protoc` serves two purposes:\n\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC service clients for use with [grpc-web](https://github.com/improbable-eng/grpc-web) or [grpc-node](https://github.com/grpc/grpc-node).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\n\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=grpc-web` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=grpc-web:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport {\n  UserServiceClient,\n  GetUserRequest\n} from \"../generated/users_pb_service\";\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => {\n  /* ... */\n});\n```\n\n### Generating gRPC Service Stubs for use with grpc-node\n\nThis plugin can generate `.d.ts` files for gRPC service definitions as required by [grpc-node](https://github.com/grpc/grpc-node).\n\nTo generate these declaration files from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=grpc-node` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Path to the grpc_node_plugin\nPROTOC_GEN_GRPC_PATH=\"./node_modules/.bin/grpc_tools_node_protoc_plugin\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --plugin=protoc-gen-grpc=${PROTOC_GEN_GRPC_PATH} \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=grpc-node:${OUT_DIR}\" \\\n    --grpc_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `_grpc_pb.js` and `_grpc_pb.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** This plugin does not generate the `_grpc_pb.js` files itself; those are generated by the protoc-gen-grpc plugin. This plugin only generates the `_grpc_pb.d.ts` files.\n\n#### Using `@grpc/grpc-js` instead of `grpc`\n\nAdd a mode parameter to generate files that import `@grpc/grpc-js` instead of `grpc`, for example:\n\n```\n--ts_out=\"service=grpc-node,mode=grpc-js:${OUT_DIR}\"\n```\n\nYou'll also need to specify the `grpc_js` option within the `--grpc_out` flag, for example:\n\n```\n--grpc_out=\"grpc_js:${OUT_DIR}\"\n```\n\n## Examples\n\n- [Example output](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples) -- Code generated by `ts-protoc-gen`.\n- [Packaging the output as a node module](https://github.com/improbable-eng/ts-protoc-gen/issues/173) -- Example of how to use the generated code as a dependendecy of another module.\n\n## Gotchas\n\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.12.1-pre.6383416","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-SDhPp1Fths72CiSamdKJFFLEMDFw3WwzfELxJvat53hpjsr64zmU1cnkfPLMBXtInEnxn2cyu1mCiK87iDObLw==","shasum":"c3114afa3041f601c162b45d9af80674d504deab","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.12.1-pre.6383416.tgz","fileCount":82,"unpackedSize":166538,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWoQUCRA9TVsSAnZWagAABTkQAJmgbMK/XYIPPlyvHsjL\nxdi2yxgMUlMPsqFLIslQC/Ln3/BeApq6OnSPT1MpaAlXhFVeX0W4hWrT718K\n1/U/moWwe9KeNmqhqLaQoxVCHCuBAKA7OsdEa24RMgyy/XwpAVHufN2n/Sss\nD0ENI5nnPg/v/u1lIxFCiRNxb2U5LxPitLClmkyzxvhusmiTpmv4Cphz3vuX\ns+8eEJK8h+qMWHKDJFkfMDtLLq2m6tRBo9lTM4WvVT25i4cN7qadxQRbtF7A\nR2dCZPEzxCzWbZ6hpbXFMlBDZRkEpoYijK3QhuGpAoM3hWodnDFTBXTxbgA2\nVxDwab1EJJGeOIjsj3Ivt5kcCJzCN7WUv9fJgrs2BR+jo8pSqhkb5z0Yj/5P\nCMErqOLt9DkIl6ZL0LefvFd1OEK68jHkdr8E7wvuxHxKtl2iGOHZLe7tMa5G\npaFzWg3Aw41RfNMJ670vmANlkMkfuM27xCwObM7RlzlHmsGbJp+OjcfeLxlL\nlfy7AECLTaBs4Kx3KQCVM6vaI6EX/DyKz1heZ90Cy1L995Q10bwNiMy4gx+w\nj2lCmMltLEvKDvyb/FDTguexHpEuctznUsVBSnPQxtvopWcCJeUbrkp4FeHF\n1ku+GSL//B4l6lVq/X99P3FxI6Xh9vyOoGHbxQjHxNQIn6E3C/TCWgtkoWUd\njqyt\r\n=8SVt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHVwCAUUyuwdwCOu/W49+h3jL2ae68DT3jRTW0iadvQkAiEAzEzSRjBBSwgMM/rXZJwlLOgHi9ddC/PXWUcGgS86ZSI="}]},"maintainers":[{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"},{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"}],"_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.12.1-pre.6383416_1599767572015_0.1844106100861851"},"_hasShrinkwrap":false},"0.13.0":{"name":"ts-protoc-gen","version":"0.13.0","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json \"test/**/*.ts\" \"src/**/*.ts\"","lint:fix":"npm run lint -- --fix","clean":"rimraf lib","build":"run-s clean tsc","generate":"node generate.js","tsc":"tsc","test":"run-s test:unit test:integration","test:unit":"node test/mocha-run-suite.js \"test/unit/**/*.ts\"","test:integration":"node test/mocha-run-suite.js \"test/integration/**/*.ts\"","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@improbable-eng/grpc-web":"^0.9.1","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","download-cli":"^1.1.1","glob":"^7.1.4","grpc":"^1.24.2","grpc-tools":"^1.9.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","npm-run-all":"^4.1.5","rimraf":"^2.6.3","source-map-support":"^0.4.18","ts-node":"^8.3.0","tslint":"^5.9.1","tsutils":"2.27.2","typescript":"~3.1.6"},"gitHead":"d58dfe26c1a5c956e0fe2d6af3a85d6d6de7a173","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.13.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-j18X4rkDBbG/ZHUJy88WFeZP6mStGow5uREaohowlHXTu3/N7WcpyPhb7Vh6wN38ERmc/AkT9gqT98+vtlRhJA==","shasum":"2763ae4e4a1a7d7001d53d2f3043357c691701ea","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.13.0.tgz","fileCount":82,"unpackedSize":166681,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfWz/pCRA9TVsSAnZWagAAvaMP/1VTYkhDLLnw2MB/THne\n5kvquaMKJSVTOa+fwknef7vgaXrsj7JS+D98ad4d3cP9gb3TGOkBnPOkOxzn\nmCYSQ7KAGiqL7wGnbU3+oOP1aelc05QBlhsi45PRXxA4Vid1y3jf+5utXblL\nlI4q5TI1vFx0fhZ4FE0Hnuj+oUbR3BS8pfd0Nt8rvXewjNngT6YeNpjplnvd\nqrrnOGV92scZX2VPPIWxFTM/SuwCPmaVheiRYl5G9n5nK0Pr7NtsdiCFN/+v\n1vAHvWlMiFpHNZvX6v3S12Ns0Az5o2A1aJE8r32NBsrhtIH3dIwEAOtE9DTH\nRKsxsb4/mwALPrxEoCOVOJJr3uC7G9j5EopuVTiKGMlbHBS5sRn/WflNTr5q\nldfFCJlQX2q/DLuTEmd1S+lDS3XIq4HOk3ZwIo+WzKELXt0f9go77iB8Etu5\n6ycJ4H80GQJc5Wxr+TEPzRC0k/xaIH8o0kaYYpSSB7A7HdDGKSTSz+M89/tP\nUx/IZtNYVEAuLPfRK7vrjBk23hPcyD8h+p8jb1bbm3Y7WzvObjhkrxZhCQdp\nY3auFJcrLKo4vfRC69RueXNeYVgFwSbcMeGb9+NklB67Zjztx4q3Hy2EU5Bn\neo73uYKv3H9irGnsxG0wYEVg+qfBtl0ubqF8YwFc3OOkHXpiLqKAGC9PqZc1\nC82+\r\n=5odj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDbe1DSSIpj1tpOiSH5ja6KfoYB68HuhFfcUJQ7fyWlDAiBGYZlbzee4YMuC24JykM9qxyAcp08ekkfiQVIWH/NWUA=="}]},"maintainers":[{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"},{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"}],"_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.13.0_1599815657149_0.3623398373229174"},"_hasShrinkwrap":false},"0.13.1-pre.2e080f3":{"name":"ts-protoc-gen","version":"0.13.1-pre.2e080f3","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json \"test/**/*.ts\" \"src/**/*.ts\"","lint:fix":"npm run lint -- --fix","clean":"rimraf lib","build":"run-s clean tsc","generate":"node generate.js","tsc":"tsc","test":"run-s test:unit test:integration","test:unit":"node test/mocha-run-suite.js \"test/unit/**/*.ts\"","test:integration":"node test/mocha-run-suite.js \"test/integration/**/*.ts\"","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@improbable-eng/grpc-web":"^0.9.1","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","download-cli":"^1.1.1","glob":"^7.1.4","grpc":"^1.24.2","grpc-tools":"^1.9.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","npm-run-all":"^4.1.5","rimraf":"^2.6.3","source-map-support":"^0.4.18","ts-node":"^8.3.0","tslint":"^5.9.1","tsutils":"2.27.2","typescript":"~3.1.6"},"gitHead":"fe77a639438af8acf5230b8348b5a6591681c7ad","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations\n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web), and as `.d.ts` files in the structure required by [grpc-node](https://github.com/grpc/grpc-node).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\n\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n\nThe bazel rules have been moved to a separate project [here](https://github.com/Dig-Doug/rules_typescript_proto).\nThere is a\n[migration guide](https://github.com/Dig-Doug/rules_typescript_proto/blob/master/docs/migrating_from_ts_protoc_gen.md)\nfor existing users.\n\n## Contributing\n\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\n\nAs mentioned above, this plugin for `protoc` serves two purposes:\n\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC service clients for use with [grpc-web](https://github.com/improbable-eng/grpc-web) or [grpc-node](https://github.com/grpc/grpc-node).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\n\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=grpc-web` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=grpc-web:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport {\n  UserServiceClient,\n  GetUserRequest\n} from \"../generated/users_pb_service\";\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => {\n  /* ... */\n});\n```\n\n### Generating gRPC Service Stubs for use with grpc-node\n\nThis plugin can generate `.d.ts` files for gRPC service definitions as required by [grpc-node](https://github.com/grpc/grpc-node).\n\nTo generate these declaration files from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=grpc-node` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Path to the grpc_node_plugin\nPROTOC_GEN_GRPC_PATH=\"./node_modules/.bin/grpc_tools_node_protoc_plugin\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --plugin=protoc-gen-grpc=${PROTOC_GEN_GRPC_PATH} \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=grpc-node:${OUT_DIR}\" \\\n    --grpc_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `_grpc_pb.js` and `_grpc_pb.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** This plugin does not generate the `_grpc_pb.js` files itself; those are generated by the protoc-gen-grpc plugin. This plugin only generates the `_grpc_pb.d.ts` files.\n\n#### Using `@grpc/grpc-js` instead of `grpc`\n\nAdd a mode parameter to generate files that import `@grpc/grpc-js` instead of `grpc`, for example:\n\n```\n--ts_out=\"service=grpc-node,mode=grpc-js:${OUT_DIR}\"\n```\n\nYou'll also need to specify the `grpc_js` option within the `--grpc_out` flag, for example:\n\n```\n--grpc_out=\"grpc_js:${OUT_DIR}\"\n```\n\nIf you're consuming the server interface types you'll need to use version `@grpc/grpc-js@1.2.0` or higher.\n\n## Examples\n\n- [Example output](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples) -- Code generated by `ts-protoc-gen`.\n- [Packaging the output as a node module](https://github.com/improbable-eng/ts-protoc-gen/issues/173) -- Example of how to use the generated code as a dependendecy of another module.\n\n## Gotchas\n\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.13.1-pre.2e080f3","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-700qL5syekymhQHMrO0nSzCUZs6pH5dbNgch19NqLJ7q5w3IjqbKnA8MQA4Ww1bogEoWlAtRazvQx19X3b4QMg==","shasum":"029dfc8d2adf068fd8f16841cd9c004ddb5dd1b0","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.13.1-pre.2e080f3.tgz","fileCount":83,"unpackedSize":168914,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf0oVHCRA9TVsSAnZWagAAk54P/iJHSy8AWUsTxCYO1Q15\nn7HJWE5HYrUBx8MiucW7Hl5ie5hh91zqJniT/iB3xhx2Dg7LtYkbJb/hmb6j\nNYBMqjl/1iuc9nwQarqa59NcC8+JfgzBxxusXqgfi69ZhyBKFX+IW9kH+MfV\nLC4wdJxs+G2CQkW+TSVxG2Gfh0QcBtQqp5sPX1W2uD4xne/gWBhlW348v/Il\ntS/Q2PWOsVQr827UF6GmG4oPS9OD4dsSgQ2WH6abB9R6Vkonopg0ISfmKfVQ\nxY73/tAni94KWt4HjnlauuCCjc/uHdBIT9oZVF7D57m51S28+qGqzDdy8pGD\ndoIYYsHev31iv1VycuCvp+x+5TBrB1l3sEkxFb9bX22FRhlN+ZGlJ26FNlJE\nm/lG2vlSd9SeuAeiVNE1Am6SUIpUDOGtR5I/RSVWA/8CarcaZn4c93u5fuZ/\nTbL2OFqgbPsFt/zAIXcC7ZtGMJ9VBvP8+JogfUtbQvXnNc6wFbCARqbn6w+r\nR+rVgtP/loEtJmb99U8newFZiCRI/FMxoKLvCAHfdbyoM/+So8fXryQRYPGV\n40LW2sXY0SGl3ypQAcJ7JNoKkR2hYJBb69cT2kuNDCicO1Bo7ORTwbVcYweb\nO0YDqKFy6+6FiFlOaJMCI0EHfFhEFANYLbN3eFBDglO+JcrgHioYKQ3xUzpb\n2guD\r\n=2Vwy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFkCcVa1b/gPvHdNexFxtIWfSy6CIbT9Hy3riz+G4HMPAiBECF5cETcGXxe4HaaXYe3/Wrp9TS7P6i6H+l7RWyqkJQ=="}]},"_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"directories":{},"maintainers":[{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"},{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.13.1-pre.2e080f3_1607632198595_0.752998014842766"},"_hasShrinkwrap":false},"0.14.0":{"name":"ts-protoc-gen","version":"0.14.0","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json \"test/**/*.ts\" \"src/**/*.ts\"","lint:fix":"npm run lint -- --fix","clean":"rimraf lib","build":"run-s clean tsc","generate":"node generate.js","tsc":"tsc","test":"run-s test:unit test:integration","test:unit":"node test/mocha-run-suite.js \"test/unit/**/*.ts\"","test:integration":"node test/mocha-run-suite.js \"test/integration/**/*.ts\"","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@improbable-eng/grpc-web":"^0.9.1","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","download-cli":"^1.1.1","glob":"^7.1.4","grpc":"^1.24.2","grpc-tools":"^1.9.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","npm-run-all":"^4.1.5","rimraf":"^2.6.3","source-map-support":"^0.4.18","ts-node":"^8.3.0","tslint":"^5.9.1","tsutils":"2.27.2","typescript":"~3.1.6"},"gitHead":"2a80c6f94079e4b1ec2f067ab762b1421fe13e0c","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.14.0","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-2z6w2HioMCMVNcgNHBcEvudmQfzrn+3BjAlz+xgYZ9L0o8n8UG8WUiTJcbXHFiEg2SU8IltwH2pm1otLoMSKwg==","shasum":"a6f4c3fc37d1d449915551c18404fb7e9aa8fef6","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.14.0.tgz","fileCount":83,"unpackedSize":169084,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2MXlCRA9TVsSAnZWagAAz+8QAJBxiSIgDbi5zht/d3Pz\nvpNa88hYQ+w9IRXciARFnB3SbBXtWrnUV1VYOLMVlG0C27du21IPu+gdJ5FF\n/kiW3p8TSSEwlu94SLgA0pSqEdwnIj1BxWYQkYUj/jrs0aRUntOt/kA2qvkQ\nZbZ4sEvTpC4btIIsX7gArH+s0h8OiUw32IkXLOP5xtuW7phT5JqyVmxRR7aC\nwQiNBxRD0rKl+2ZnzN8+4+AhAs5ebA92xl4h1j5bZfyVagx245XWy12wjyh+\nXsPKW/YJi71Se1Dzq7ppWFsFXU8WmAgJukyNkYDFMeR+xL3D2uwLuU2lpaT1\nmmcEPS1qAr8GBgl5ZEyN1kH/leX3YbB/ZtR0wmevwxR3EiTWdMZNjqkwBLuM\ncsJx/ilDeppHFUzYN64NiyYSKRPQckRXZTmXlKMjMwmxuhqtMvq7zj1cEDbq\n7jN6Z9hnGCpTaEARWmSDL152sUVq62CiwG3unVO9TO1WSzxaSzjgyuee/sfb\nCtpirJtrxZV+rPCsqzHR92OalGH8FFOmNH7zIFmWDQ5n3f/6s/Zx4UdJvKNF\nIg6cAjyH7nWPrvYDgm9syQX7U08GLTxemuA9XE98CefL/THz6L5SMEgw3V4g\nklNCAkkwSqFVRMnYdYPB7XVWtr9sef1ROHRGEcKQRo+P43blk86CZ5xCJ3ZV\nZ6D+\r\n=UqLk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDy2Q5QVKTffYFOsJDPo5MAENHzmLqJfczbTDFI3/WiCgIgFE8d6vwBUhNhgfafv6KBcFa1FHArMFE3+gvpbmARRhw="}]},"_npmUser":{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"},"directories":{},"maintainers":[{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"},{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.14.0_1608041957393_0.29769311078470095"},"_hasShrinkwrap":false},"0.14.1-pre.02149e6":{"name":"ts-protoc-gen","version":"0.14.1-pre.02149e6","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json \"test/**/*.ts\" \"src/**/*.ts\"","lint:fix":"npm run lint -- --fix","clean":"rimraf lib","build":"run-s clean tsc","generate":"node generate.js","tsc":"tsc","test":"run-s test:unit test:integration","test:unit":"node test/mocha-run-suite.js \"test/unit/**/*.ts\"","test:integration":"node test/mocha-run-suite.js \"test/integration/**/*.ts\"","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@improbable-eng/grpc-web":"^0.9.1","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","download-cli":"^1.1.1","glob":"^7.1.4","grpc":"^1.24.2","grpc-tools":"^1.9.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","npm-run-all":"^4.1.5","rimraf":"^2.6.3","source-map-support":"^0.4.18","ts-node":"^8.3.0","tslint":"^5.9.1","tsutils":"2.27.2","typescript":"~3.1.6"},"gitHead":"3ff1d2b4478b743ed83d6d2e01a4a5a21de26a47","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations\n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web), and as `.d.ts` files in the structure required by [grpc-node](https://github.com/grpc/grpc-node).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\n\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n\nThe bazel rules have been moved to a separate project [here](https://github.com/Dig-Doug/rules_typescript_proto).\nThere is a\n[migration guide](https://github.com/Dig-Doug/rules_typescript_proto/blob/master/docs/migrating_from_ts_protoc_gen.md)\nfor existing users.\n\n## Contributing\n\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\n\nAs mentioned above, this plugin for `protoc` serves two purposes:\n\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC service clients for use with [grpc-web](https://github.com/improbable-eng/grpc-web) or [grpc-node](https://github.com/grpc/grpc-node).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\n\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=grpc-web` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=grpc-web:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport {\n  UserServiceClient,\n  GetUserRequest\n} from \"../generated/users_pb_service\";\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => {\n  /* ... */\n});\n```\n\n### Generating gRPC Service Stubs for use with grpc-node\n\nThis plugin can generate `.d.ts` files for gRPC service definitions as required by [grpc-node](https://github.com/grpc/grpc-node).\n\nTo generate these declaration files from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=grpc-node` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Path to the grpc_node_plugin\nPROTOC_GEN_GRPC_PATH=\"./node_modules/.bin/grpc_tools_node_protoc_plugin\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --plugin=protoc-gen-grpc=${PROTOC_GEN_GRPC_PATH} \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=grpc-node:${OUT_DIR}\" \\\n    --grpc_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `_grpc_pb.js` and `_grpc_pb.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** This plugin does not generate the `_grpc_pb.js` files itself; those are generated by the protoc-gen-grpc plugin. This plugin only generates the `_grpc_pb.d.ts` files.\n\n#### Using `@grpc/grpc-js` instead of `grpc`\n\nAdd a mode parameter to generate files that import `@grpc/grpc-js` instead of `grpc`, for example:\n\n```\n--ts_out=\"service=grpc-node,mode=grpc-js:${OUT_DIR}\"\n```\n\nYou'll also need to specify the `grpc_js` option within the `--grpc_out` flag, for example:\n\n```\n--grpc_out=\"grpc_js:${OUT_DIR}\"\n```\n\nIf you're consuming the server interface types you'll need to use version `@grpc/grpc-js@1.2.0` or higher.\n\n## Examples\n\n- [Example output](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples) -- Code generated by `ts-protoc-gen`.\n- [Packaging the output as a node module](https://github.com/improbable-eng/ts-protoc-gen/issues/173) -- Example of how to use the generated code as a dependendecy of another module.\n\n## Gotchas\n\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.14.1-pre.02149e6","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-y7FBZSeildJEJzK2Tr3CwkA+E1oCw32agVCa1AeQJjUDSMjTELfil3MrKSkMVdsti/MTFt4v33Qg1tE0PzHK0g==","shasum":"67172eee2761d8f35b22ad9d7585925d830e893e","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.14.1-pre.02149e6.tgz","fileCount":83,"unpackedSize":169111,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2NHACRA9TVsSAnZWagAAHyMQAKH4phjJIUS0lxuC7Zni\nWjPQwR8ccJBHUWMjRVxvutxvLOMNJVa2WxgAn2nktydsw6d3KFOAP8Hb2dTx\nzEQ96YgL4o++VHDeQTo/y3oP6SnsFHnYoOlNtP+X1xapcGBsJI2tD3vbNfto\nGBuVSz2TDeK3g5WI/UaY9Y1yWKaZyRW94bHUKZhSPUMBYC80e71NdnaO+Y7K\nKvJPTPGP5umyWaV2SXgAUe2nkwzeWr4kPhYJiHaDrinekXnGMIVF7V5l8ECH\nPatG5roHUHfmeVmvZVz2OEiD3dtnjqZsR/Fm5D2sytQbc3dB9rj0wP+Ojpw+\nZUHYadR2VoleZVUxq48zVF78Xr/WQhN1jEcWD055TZOs7xt4pNAfhCqKReoa\nDbyx6JRmmDnV5bo56bn0CElFmHDalUbk1kMfIW7sb5r74dWj+H9AZlXZPezn\nG6NP7xnirtOFFin/88H2DZ25Qlr8lVsxzZkCxNWIB+QUNJBEYfYVEzllwsA6\niOyoV5+DdActAeAfXxwuczc1lAR45CYCfIrQM641ty0UnOhNqUOzKM15ynMv\nrTPoDF2251uqn7xVmo35yH0zlGkwBwktyp5FEzPnz+q3RYvb7CrSiHYV3/79\ntrqXhjblURi3hi2VHDC1BvcnlDFSy8JlGalbtHr2dTgmBPor0Mtc0gunpHcU\no+b7\r\n=/DFD\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDY+argt02shULXSdAQdyi7cZambqMdcJAGQTNVwGyoPAIgNZ33/qTc+svO1E2fs914tWakPRnVgpocJsdmxUdErRw="}]},"_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"directories":{},"maintainers":[{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"},{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.14.1-pre.02149e6_1608044991612_0.44729327526815577"},"_hasShrinkwrap":false},"0.14.1-pre.e680d69":{"name":"ts-protoc-gen","version":"0.14.1-pre.e680d69","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json \"test/**/*.ts\" \"src/**/*.ts\"","lint:fix":"npm run lint -- --fix","clean":"rimraf lib","build":"run-s clean tsc","generate":"node generate.js","tsc":"tsc","test":"run-s test:unit test:integration","test:unit":"node test/mocha-run-suite.js \"test/unit/**/*.ts\"","test:integration":"node test/mocha-run-suite.js \"test/integration/**/*.ts\"","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.6.1"},"devDependencies":{"@improbable-eng/grpc-web":"^0.9.1","@types/chai":"^3.5.2","@types/google-protobuf":"^3.2.7","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","download-cli":"^1.1.1","glob":"^7.1.4","grpc":"^1.24.2","grpc-tools":"^1.9.0","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","npm-run-all":"^4.1.5","rimraf":"^2.6.3","source-map-support":"^0.4.18","ts-node":"^8.3.0","tslint":"^5.9.1","tsutils":"2.27.2","typescript":"~3.1.6"},"gitHead":"727b651c83755ef3561c58367ef391dedd1378f1","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations\n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web), and as `.d.ts` files in the structure required by [grpc-node](https://github.com/grpc/grpc-node).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\n\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n\nThe bazel rules have been moved to a separate project [here](https://github.com/Dig-Doug/rules_typescript_proto).\nThere is a\n[migration guide](https://github.com/Dig-Doug/rules_typescript_proto/blob/master/docs/migrating_from_ts_protoc_gen.md)\nfor existing users.\n\n## Contributing\n\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\n\nAs mentioned above, this plugin for `protoc` serves two purposes:\n\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC service clients for use with [grpc-web](https://github.com/improbable-eng/grpc-web) or [grpc-node](https://github.com/grpc/grpc-node).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\n\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=grpc-web` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=grpc-web:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport {\n  UserServiceClient,\n  GetUserRequest\n} from \"../generated/users_pb_service\";\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => {\n  /* ... */\n});\n```\n\n### Generating gRPC Service Stubs for use with grpc-node\n\nThis plugin can generate `.d.ts` files for gRPC service definitions as required by [grpc-node](https://github.com/grpc/grpc-node).\n\nTo generate these declaration files from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=grpc-node` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Path to the grpc_node_plugin\nPROTOC_GEN_GRPC_PATH=\"./node_modules/.bin/grpc_tools_node_protoc_plugin\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --plugin=protoc-gen-grpc=${PROTOC_GEN_GRPC_PATH} \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=grpc-node:${OUT_DIR}\" \\\n    --grpc_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `_grpc_pb.js` and `_grpc_pb.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** This plugin does not generate the `_grpc_pb.js` files itself; those are generated by the protoc-gen-grpc plugin. This plugin only generates the `_grpc_pb.d.ts` files.\n\n#### Using `@grpc/grpc-js` instead of `grpc`\n\nAdd a mode parameter to generate files that import `@grpc/grpc-js` instead of `grpc`, for example:\n\n```\n--ts_out=\"service=grpc-node,mode=grpc-js:${OUT_DIR}\"\n```\n\nYou'll also need to specify the `grpc_js` option within the `--grpc_out` flag, for example:\n\n```\n--grpc_out=\"grpc_js:${OUT_DIR}\"\n```\n\nIf you're consuming the server interface types you'll need to use version `@grpc/grpc-js@1.2.0` or higher.\n\n## Examples\n\n- [Example output](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples) -- Code generated by `ts-protoc-gen`.\n- [Packaging the output as a node module](https://github.com/improbable-eng/ts-protoc-gen/issues/173) -- Example of how to use the generated code as a dependendecy of another module.\n\n## Gotchas\n\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.14.1-pre.e680d69","_nodeVersion":"12.13.0","_npmVersion":"6.12.0","dist":{"integrity":"sha512-Pqs7xWAB1KmFHqyVpR3OuIUfHd6neEyg1tFw9eGTRbunfT3jEFT3bPLlWlILfqv+5+XxuYQdAi6aB5GGhTh/Bg==","shasum":"5c38c33c453fb7a60a8d487919e73bad2fe5c7df","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.14.1-pre.e680d69.tgz","fileCount":83,"unpackedSize":169146,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJf2PPMCRA9TVsSAnZWagAAX+AQAJmUoq0F/PcR5501WBkZ\nfXok8f2vCNw3e6UbEdh2/YhviHjB+LWiFvKe/gUa6ZXzfTlnINb6bEkXkGA/\nS/YDPSxn190HzBuapmFcdquqpUAO8IeHLLPsVd6ezNfvWUuMS96W3hrzaIIC\n6MRRVd7UcO0H+HBKTLMiWmgKXfy08VWiwHdcwBwWYDyZEtMiw+sV6SmCfeTh\n/F22HL5uW0gtpdhf7IYD6eBdvztYKKwpZ6KDuIOEaagOxzgO9N1li3SZY/L4\n8TE7PsHcrnSzkz4wR39dOFtFy99ACMMiLTVjWv7EZ7eDqNnugtRszp2GuqJ2\nRBctoW3ckJE1ohPWHZbP2c6ZPGfzcNaIjRiPRb2Q4+/iAtQ+/BQb3X3B4CbG\nOxzk7mULUrChE3ne7pXg+3f32LGDofq/4C1rFgKCfKZJxnwdPlERagdL5Vy8\nR+yR8GWlSDp+y+CEOJwYuxUstdhHQ770mGbj8BJF/R++uGuvQSJWbUqfiyRB\n5IrQSvIs5+iaNgc0zPnrFgHvgWftRKjBdcsqnh3kIQXTCS9PG6HZGKKlW5UN\nYjtsyF5pdfN39MFU+46lzNtO19c79Hftno6Wka548sf4zPIW7NT9LIgWbbBj\nmvCG/MwIArvM4wR5GLNkvjfiwJRZJfeR5tbYC6hHw6AkxrWnNcbpFaXvBewC\nqSou\r\n=ysZZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAeJSeC5YM3xA1BGwwWcGdfT+EfdnrvG0zvCF3vgvBgbAiEA/CaWleD1aNhJUvHk6I/ozIpObXNUImbhgjvlWuaUzhk="}]},"_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"directories":{},"maintainers":[{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"},{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.14.1-pre.e680d69_1608053708217_0.6138093857373339"},"_hasShrinkwrap":false},"0.14.1-pre.d492bcc":{"name":"ts-protoc-gen","version":"0.14.1-pre.d492bcc","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json \"test/**/*.ts\" \"src/**/*.ts\"","lint:fix":"npm run lint -- --fix","clean":"rimraf lib","build":"run-s clean tsc","generate":"node generate.js","tsc":"tsc","test":"run-s test:unit test:integration","test:unit":"node test/mocha-run-suite.js \"test/unit/**/*.ts\"","test:integration":"node test/mocha-run-suite.js \"test/integration/**/*.ts\"","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.15.5"},"devDependencies":{"@improbable-eng/grpc-web":"^0.9.1","@types/chai":"^3.5.2","@types/google-protobuf":"^3.7.4","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","download-cli":"^1.1.1","glob":"^7.1.4","grpc":"^1.24.6","grpc-tools":"^1.11.1","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","npm-run-all":"^4.1.5","rimraf":"^2.6.3","source-map-support":"^0.4.18","ts-node":"^8.3.0","tslint":"^5.9.1","tsutils":"2.27.2","typescript":"~3.1.6"},"gitHead":"ac760a108690a0285ccfec032601ca2e88fee1cd","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations\n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web), and as `.d.ts` files in the structure required by [grpc-node](https://github.com/grpc/grpc-node).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\n\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n\nThe bazel rules have been moved to a separate project [here](https://github.com/Dig-Doug/rules_typescript_proto).\nThere is a\n[migration guide](https://github.com/Dig-Doug/rules_typescript_proto/blob/master/docs/migrating_from_ts_protoc_gen.md)\nfor existing users.\n\n## Contributing\n\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\n\nAs mentioned above, this plugin for `protoc` serves two purposes:\n\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC service clients for use with [grpc-web](https://github.com/improbable-eng/grpc-web) or [grpc-node](https://github.com/grpc/grpc-node).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\n\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=grpc-web` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=grpc-web:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport {\n  UserServiceClient,\n  GetUserRequest\n} from \"../generated/users_pb_service\";\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => {\n  /* ... */\n});\n```\n\n### Generating gRPC Service Stubs for use with grpc-node\n\nThis plugin can generate `.d.ts` files for gRPC service definitions as required by [grpc-node](https://github.com/grpc/grpc-node).\n\nTo generate these declaration files from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=grpc-node` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Path to the grpc_node_plugin\nPROTOC_GEN_GRPC_PATH=\"./node_modules/.bin/grpc_tools_node_protoc_plugin\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --plugin=protoc-gen-grpc=${PROTOC_GEN_GRPC_PATH} \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=grpc-node:${OUT_DIR}\" \\\n    --grpc_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `_grpc_pb.js` and `_grpc_pb.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** This plugin does not generate the `_grpc_pb.js` files itself; those are generated by the protoc-gen-grpc plugin. This plugin only generates the `_grpc_pb.d.ts` files.\n\n#### Using `@grpc/grpc-js` instead of `grpc`\n\nAdd a mode parameter to generate files that import `@grpc/grpc-js` instead of `grpc`, for example:\n\n```\n--ts_out=\"service=grpc-node,mode=grpc-js:${OUT_DIR}\"\n```\n\nYou'll also need to specify the `grpc_js` option within the `--grpc_out` flag, for example:\n\n```\n--grpc_out=\"grpc_js:${OUT_DIR}\"\n```\n\nIf you're consuming the server interface types you'll need to use version `@grpc/grpc-js@1.2.0` or higher.\n\n## Examples\n\n- [Example output](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples) -- Code generated by `ts-protoc-gen`.\n- [Packaging the output as a node module](https://github.com/improbable-eng/ts-protoc-gen/issues/173) -- Example of how to use the generated code as a dependendecy of another module.\n\n## Gotchas\n\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.14.1-pre.d492bcc","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-K2RMCx4gv4G3dwDgr9PJRGK7IjCDT08BrjoKW8bVvJxsoZOyI5XuloOxTMD5yN6QZyD06NjkjvnJYUtuI621lg==","shasum":"cb35cc8469b7a0ab0ac3bafd89218f41e0212213","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.14.1-pre.d492bcc.tgz","fileCount":83,"unpackedSize":175613,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgXKXrCRA9TVsSAnZWagAAvroQAJwnQs4ncYg9A4FGGbnO\n2n5My1c+yrqCcOC550JCHZp2M4cnh8Fd4nsBnXQC48X8ICG1gzGgSEkcrdp1\nKJCvQK42eMsdX7tuknc+s0FEKWFI3XF3oq/SeM8+X7QkINvjx/z2vuAElJpW\nCYK/o17fOsn2vnROPTKPZJfxsXCrg6eoRbzwzoM2E2wQz0YQC8fMcRD0Q8dk\nGgEJIe6rfNmsnZL2GIklTe9XEzK6qqt/UmaFRKfwuX6O+a6bn3UZSV9gLowv\n7o/AukzZFnP74YGDVk3mk2I6PIXc/A70Wg+uoIiUjn+lMweqTA3ChSdinf+R\nj5B1O3oY0oZFd17quxFOhKCGUQKDApqydDT+U9AoU1t2QVvRuuORfghUV78z\ndOVSTRtg4YndSY4h8iRWucs7wLZgKtJyoG4+ZLgrwUMktQIj2BE+JVh4dveg\nhgKAb4KeycZqjAQG/EpVaiZXtiEJT8lizaFP5KjOkmP3g18hRdKmoQ5DfI8W\nIZE2hiutEUOYyhzHOawgCetqSgczYObG8A8B8zX+U0Ei7kOexa+p+KIZ0f+a\nf531DPjm29PAo07b75Qfu91LP8mxEm5Ju5uXms9Br7O98ylaNfFy1GBc8+pr\nsU47s5873Fiur1LVKKSHNfhK6fLgb/oi2IScLc8wDYSF3T0MFps++4Og7+X0\nen8N\r\n=HZ5+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCxRs2ZupZtxXiWipN77/FFxIEaxsSC8s/BYMtYgaauiAIgKcAglIwFzvoMNGc38dpTxYC0ff+hUDAkpJIEgSYjM6c="}]},"_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"directories":{},"maintainers":[{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"},{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.14.1-pre.d492bcc_1616684523470_0.043471392888599025"},"_hasShrinkwrap":false},"0.14.1-pre.fd6e3a0":{"name":"ts-protoc-gen","version":"0.14.1-pre.fd6e3a0","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json \"test/**/*.ts\" \"src/**/*.ts\"","lint:fix":"npm run lint -- --fix","clean":"rimraf lib","build":"run-s clean tsc","generate":"node generate.js","tsc":"tsc","test":"run-s test:unit test:integration","test:unit":"node test/mocha-run-suite.js \"test/unit/**/*.ts\"","test:integration":"node test/mocha-run-suite.js \"test/integration/**/*.ts\"","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.15.5"},"devDependencies":{"@improbable-eng/grpc-web":"^0.9.1","@types/chai":"^3.5.2","@types/google-protobuf":"^3.15.0","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","download-cli":"^1.1.1","glob":"^7.1.4","grpc":"^1.24.6","grpc-tools":"^1.11.1","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","npm-run-all":"^4.1.5","rimraf":"^2.6.3","source-map-support":"^0.4.18","ts-node":"^8.3.0","tslint":"^5.9.1","tsutils":"2.27.2","typescript":"~3.1.6"},"gitHead":"914df63268db084ee62e921476cfbf5cae7dd59a","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations\n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web), and as `.d.ts` files in the structure required by [grpc-node](https://github.com/grpc/grpc-node).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\n\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n\nThe bazel rules have been moved to a separate project [here](https://github.com/Dig-Doug/rules_typescript_proto).\nThere is a\n[migration guide](https://github.com/Dig-Doug/rules_typescript_proto/blob/master/docs/migrating_from_ts_protoc_gen.md)\nfor existing users.\n\n## Contributing\n\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\n\nAs mentioned above, this plugin for `protoc` serves two purposes:\n\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC service clients for use with [grpc-web](https://github.com/improbable-eng/grpc-web) or [grpc-node](https://github.com/grpc/grpc-node).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\n\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=grpc-web` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=grpc-web:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport {\n  UserServiceClient,\n  GetUserRequest\n} from \"../generated/users_pb_service\";\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => {\n  /* ... */\n});\n```\n\n### Generating gRPC Service Stubs for use with grpc-node\n\nThis plugin can generate `.d.ts` files for gRPC service definitions as required by [grpc-node](https://github.com/grpc/grpc-node).\n\nTo generate these declaration files from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=grpc-node` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Path to the grpc_node_plugin\nPROTOC_GEN_GRPC_PATH=\"./node_modules/.bin/grpc_tools_node_protoc_plugin\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --plugin=protoc-gen-grpc=${PROTOC_GEN_GRPC_PATH} \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=grpc-node:${OUT_DIR}\" \\\n    --grpc_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `_grpc_pb.js` and `_grpc_pb.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** This plugin does not generate the `_grpc_pb.js` files itself; those are generated by the protoc-gen-grpc plugin. This plugin only generates the `_grpc_pb.d.ts` files.\n\n#### Using `@grpc/grpc-js` instead of `grpc`\n\nAdd a mode parameter to generate files that import `@grpc/grpc-js` instead of `grpc`, for example:\n\n```\n--ts_out=\"service=grpc-node,mode=grpc-js:${OUT_DIR}\"\n```\n\nYou'll also need to specify the `grpc_js` option within the `--grpc_out` flag, for example:\n\n```\n--grpc_out=\"grpc_js:${OUT_DIR}\"\n```\n\nIf you're consuming the server interface types you'll need to use version `@grpc/grpc-js@1.2.0` or higher.\n\n## Examples\n\n- [Example output](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples) -- Code generated by `ts-protoc-gen`.\n- [Packaging the output as a node module](https://github.com/improbable-eng/ts-protoc-gen/issues/173) -- Example of how to use the generated code as a dependendecy of another module.\n\n## Gotchas\n\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.14.1-pre.fd6e3a0","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-MIgcOCrx/osL5hGeoZ3xAT5au9oDweihuRwjOcPXzsD4Mon5gSuHeeeMFzU+Lg8t/ExyOWRkmnGlcRzpIMpJuQ==","shasum":"438729c7953c005fd5735688e9f6c447d38b86d7","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.14.1-pre.fd6e3a0.tgz","fileCount":84,"unpackedSize":177497,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgg95KCRA9TVsSAnZWagAAxpYP/0mMPMtWObs1rU+ahkBC\nTzC3fzViteVbBXZVMVNdGVvGuRW3O4fsJLsUQgQpZFut6AdCgjG6pDPy6jGY\nko/gRb9NWI9jonD0HYECk0M2Nm+4o9xx9vgzVbHy1c8LPjSSfW2c/Nw8gWtq\ntHlaCutS/mI0PJhFF1NI82AcuA1qk+4R33WnOIZeJDKYyXYUGFiMGOi7/YbY\nSmF8e19d0fdIZp96pTR0t+K4vrQDEYXdS+/Ebc1pXvKwqueCitujoGpKBr2x\njKj4huOW5MoKQqfVYSLCD1WQqID3YuKs3YZyV/XsF0tAb/4sWXZNUhv+AXJl\nSBn095Gz3ZDuKeorcJM1dYRxXbEgfLTC7EUE/gPxuRFAeDmaq7rAgLMyCTkr\n0vSfTfC1qD7YhlV82DIw9cW4jqaj8ktLvMA2HjeuuSBzIkvetxDIoHkUiTMJ\nvioYmeBagWITg1r4sxT2LTFOg6QwJ0jAKdqd3CTXOg7psilw0Eh5uhrKGmoo\ngFnyGdi870a6WnVFoPDJFhj0/BUvLX6S0AicANhfsanFI6M3EUuKOFloZM/C\nBLsDKdCt1uzFKAmWztl5zzTcawHEP66vGiO4v3fU21ek9UbZYesXw6UCqzKn\n9rbd8cvx/WCmc9TLPrZXu0opBvB/M2CoIs5Hd/SGauhDZ5vqw56K1V55AHhT\nPSv7\r\n=QSs+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAVTSdijtbrAIyEyXgX0lgpHUNg9lXshCQ0VxuSUHijBAiA+4WIiWjeIkQUYO1a3UfsRHbbj5AeSFz0hYYTIh/aWJQ=="}]},"_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"directories":{},"maintainers":[{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"},{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.14.1-pre.fd6e3a0_1619254857999_0.39503442298058333"},"_hasShrinkwrap":false},"0.14.1-pre.77d9ada":{"name":"ts-protoc-gen","version":"0.14.1-pre.77d9ada","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json \"test/**/*.ts\" \"src/**/*.ts\"","lint:fix":"npm run lint -- --fix","clean":"rimraf lib","build":"run-s clean tsc","generate":"node generate.js","tsc":"tsc","test":"run-s test:unit test:integration","test:unit":"node test/mocha-run-suite.js \"test/unit/**/*.ts\"","test:integration":"node test/mocha-run-suite.js \"test/integration/**/*.ts\"","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.15.5"},"devDependencies":{"@improbable-eng/grpc-web":"^0.9.1","@types/chai":"^3.5.2","@types/google-protobuf":"^3.15.0","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","download-cli":"^1.1.1","glob":"^7.1.4","grpc":"^1.24.6","grpc-tools":"^1.11.1","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","npm-run-all":"^4.1.5","rimraf":"^2.6.3","source-map-support":"^0.4.18","ts-node":"^8.3.0","tslint":"^5.9.1","tsutils":"2.27.2","typescript":"~3.1.6"},"gitHead":"e4c5903fd06d807af17a279cceb4a56be1d566ad","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations\n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web), and as `.d.ts` files in the structure required by [grpc-node](https://github.com/grpc/grpc-node).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\n\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n\nThe bazel rules have been moved to a separate project [here](https://github.com/Dig-Doug/rules_typescript_proto).\nThere is a\n[migration guide](https://github.com/Dig-Doug/rules_typescript_proto/blob/master/docs/migrating_from_ts_protoc_gen.md)\nfor existing users.\n\n## Contributing\n\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\n\nAs mentioned above, this plugin for `protoc` serves two purposes:\n\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC service clients for use with [grpc-web](https://github.com/improbable-eng/grpc-web) or [grpc-node](https://github.com/grpc/grpc-node).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\n\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=grpc-web` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=grpc-web:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport {\n  UserServiceClient,\n  GetUserRequest\n} from \"../generated/users_pb_service\";\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => {\n  /* ... */\n});\n```\n\n### Generating gRPC Service Stubs for use with grpc-node\n\nThis plugin can generate `.d.ts` files for gRPC service definitions as required by [grpc-node](https://github.com/grpc/grpc-node).\n\nTo generate these declaration files from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=grpc-node` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Path to the grpc_node_plugin\nPROTOC_GEN_GRPC_PATH=\"./node_modules/.bin/grpc_tools_node_protoc_plugin\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --plugin=protoc-gen-grpc=${PROTOC_GEN_GRPC_PATH} \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=grpc-node:${OUT_DIR}\" \\\n    --grpc_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `_grpc_pb.js` and `_grpc_pb.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** This plugin does not generate the `_grpc_pb.js` files itself; those are generated by the protoc-gen-grpc plugin. This plugin only generates the `_grpc_pb.d.ts` files.\n\n#### Using `@grpc/grpc-js` instead of `grpc`\n\nAdd a mode parameter to generate files that import `@grpc/grpc-js` instead of `grpc`, for example:\n\n```\n--ts_out=\"service=grpc-node,mode=grpc-js:${OUT_DIR}\"\n```\n\nYou'll also need to specify the `grpc_js` option within the `--grpc_out` flag, for example:\n\n```\n--grpc_out=\"grpc_js:${OUT_DIR}\"\n```\n\nIf you're consuming the server interface types you'll need to use version `@grpc/grpc-js@1.2.0` or higher.\n\n## Examples\n\n- [Example output](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples) -- Code generated by `ts-protoc-gen`.\n- [Packaging the output as a node module](https://github.com/improbable-eng/ts-protoc-gen/issues/173) -- Example of how to use the generated code as a dependendecy of another module.\n\n## Gotchas\n\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.14.1-pre.77d9ada","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-One14p+kD12xQlvKmOF/4hJuyFVcWg07DHBdu1NF5oBlvXcsQNtWqKdvS41McktJPwh/cRPEmndZdxv3p6xrug==","shasum":"882a3ea7132d276a8d5d3dcde0d16c8ceb2ecea5","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.14.1-pre.77d9ada.tgz","fileCount":85,"unpackedSize":178076,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJghz6+CRA9TVsSAnZWagAABhQP/iyJEIe6/vedw7mIyn1g\ntCPXks2j5WIX+ou3YtHwpH6kJmLiB5T1KIwoncC9sn90WKurw4jqnQdNMSnv\nbF5eYIBC/RDx0cRrHJaNDKpvY4gZHCqKmTsSt/7emWlPZx4msVN3kGR4MQkN\ncyLS+M8OEABuEnfyGDAICusIWFyp3ZhKQJH9t31yhsWxYUWyQ/WDeLThyEsU\nA8YOTSf3beCSwfauTUy0KxHUb6racX4LWN928kbgLplpJb4AR3pQn4AjNfUg\nIN0KZgwA+JvckWQCPTi1srz0Q61pmsQlDnhGdyP16qjYQ7WdUAmUrXMt7Pq1\nuPFzNar5Y8JKGz7RtGDHAg5WUIAgSnMONrLM+R0Z7FPgIKNrr5gWeM9b/hU9\n6su12aaZRftFccpCjOL8LZskuvdQSENk4I62aRDOYphksul9eiBFgMEK2umg\n6QXksPDdGdKtS8iteonNF4Vf2WeNto+g0flxxlrHmTV/IZKFD1p/bxzZzwqj\nSqLcbW/EIORV/MoEbl4hGeMP0Zoq0hf328P5DaA+P/AS2udwQilFzhsXiGf+\nbLOCxDqnv7v921gV4FaoAV4Y9yNTV4/uGSX9gGgXMLraYXeoIIpSNiKXpfmx\naBkhu6p2uIxBTp9CT9X7a08j1NvoZx1R6iMl98m4f6Wgimlx7wLhsktnZM8Z\n4Fsv\r\n=DXLS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIADaCbkJbnz0V2nKidHjN/Sd8/f7/2jb0CplhnCg57AqAiBZo6Xxwie3xijZdPu2hF36Zv/qWkNk5wmeRwWBud5arw=="}]},"_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"directories":{},"maintainers":[{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"},{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.14.1-pre.77d9ada_1619476158235_0.5328581028888226"},"_hasShrinkwrap":false},"0.15.0":{"name":"ts-protoc-gen","version":"0.15.0","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json \"test/**/*.ts\" \"src/**/*.ts\"","lint:fix":"npm run lint -- --fix","clean":"rimraf lib","build":"run-s clean tsc","generate":"node generate.js","tsc":"tsc","test":"run-s test:unit test:integration","test:unit":"node test/mocha-run-suite.js \"test/unit/**/*.ts\"","test:integration":"node test/mocha-run-suite.js \"test/integration/**/*.ts\"","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.15.5"},"devDependencies":{"@improbable-eng/grpc-web":"^0.9.1","@types/chai":"^3.5.2","@types/google-protobuf":"^3.15.0","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","download-cli":"^1.1.1","glob":"^7.1.4","grpc":"^1.24.6","grpc-tools":"^1.11.1","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","npm-run-all":"^4.1.5","rimraf":"^2.6.3","source-map-support":"^0.4.18","ts-node":"^8.3.0","tslint":"^5.9.1","tsutils":"2.27.2","typescript":"~3.1.6"},"gitHead":"bf47e9512c4aa2bfd42f25c41a6c1dad68ce7175","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.15.0","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-TycnzEyrdVDlATJ3bWFTtra3SCiEP0W0vySXReAuEygXCUr1j2uaVyL0DhzjwuUdQoW5oXPwk6oZWeA0955V+g==","shasum":"2fec5930b46def7dcc9fa73c060d770b7b076b7b","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.15.0.tgz","fileCount":85,"unpackedSize":178542,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgiAlYCRA9TVsSAnZWagAAc5wP/j4XMtF7FBnebB9UC21Z\nmaPb0emb7EAcC8lzKvtfHUXNDtx8Cyp5YAOgyZRORhQe+gdXIUuvoZVi/WHg\nGsvXb9b5oFseD2qqMIjEeu6l2/agTRcmnagBLOA+GRQDojeYpknbfxSEdfn0\nFmW2lEfGRZd68XUoVodpof/qe2eOcpTBno0hsBHscVYLGcpxvGKcFhUV42yv\nAj6qLqofo0mDUGpinaAY8tipxwNnF/2E3KFKpB0fsZPCh2XaXEb3tHCDdBoA\nK2ksqykpL8ldGsavt/ogj6fzyXP0rG4iNU+HjO6t7F9QB07xX7WmHcOiLq9I\nzhLsn1k8jTaOa0KdQFK/3cgZvKjQhAfh4jivjDiRFrBXkl0uBFe9fPUmqXvn\n/KUeSNFIvrQ9dr33sQT4aGwS/mu5RbylySgoeFxUvZWxBMAMtovNTf7/4AZ5\nntSutuWZvSrgTpwNZnPionV8WVw/Lm1+POSTqOiRVMeYNzLoeoyVwooI3Cmf\nEh8rLSixDkD4bdIwDOCSmg2rj4Ide/ZNQFKY6L6YoVxK9g4flVnBU2TqDTEO\nlz0s2VStw1BvNH4bPpoeHepyYSV8Xoh7Vjyx8JBhqoJRJlOZUo+ZlQeAzEhF\nKBh+oWsn8Xf8cNAwxNtPoxKdT1/If8elqVifzIF64dTsV8/XB6SMrN4fu4mp\nluml\r\n=DIYK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEvj4OyohmLt/6gPo/ZsWENyxJURB3Mn+OSpr7PtT51CAiBjuH652AV4iCNOuiIviXwqKrT//uydB8aYmoI9ZFp/Gw=="}]},"_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"directories":{},"maintainers":[{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"},{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.15.0_1619528023705_0.3310993964403408"},"_hasShrinkwrap":false},"0.15.1-pre.a71b34e":{"name":"ts-protoc-gen","version":"0.15.1-pre.a71b34e","description":"Protoc Plugin for TypeScript Declarations and Service Definitions","scripts":{"lint":"tslint -c tslint.json \"test/**/*.ts\" \"src/**/*.ts\"","lint:fix":"npm run lint -- --fix","clean":"rimraf lib","build":"run-s clean tsc","generate":"node generate.js","tsc":"tsc","test":"run-s test:unit test:integration","test:unit":"node test/mocha-run-suite.js \"test/unit/**/*.ts\"","test:integration":"node test/mocha-run-suite.js \"test/integration/**/*.ts\"","prepublishOnly":"npm run build"},"bin":{"protoc-gen-ts":"bin/protoc-gen-ts"},"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"author":{"name":"Improbable"},"license":"Apache-2.0","dependencies":{"google-protobuf":"^3.15.5"},"devDependencies":{"@improbable-eng/grpc-web":"^0.9.1","@types/chai":"^3.5.2","@types/google-protobuf":"^3.15.0","@types/lodash":"^4.14.106","@types/mocha":"^2.2.46","@types/node":"^7.0.52","babel":"^6.5.2","browser-headers":"^0.4.1","chai":"^3.5.0","download-cli":"^1.1.1","glob":"^7.1.4","grpc":"^1.24.6","grpc-tools":"^1.11.1","lodash":"^4.17.5","lodash.isequal":"^4.5.0","mocha":"^5.2.0","mocha-spec-json-output-reporter":"^1.1.6","npm-run-all":"^4.1.5","rimraf":"^2.6.3","source-map-support":"^0.4.18","ts-node":"^8.3.0","tslint":"^5.9.1","tsutils":"2.27.2","typescript":"~3.1.6"},"gitHead":"6eae4c9ba29720db82cdc1102f1320a0bd274815","readme":"[![Master Build](https://travis-ci.org/improbable-eng/ts-protoc-gen.svg?branch=master)](https://travis-ci.org/improbable-eng/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/v/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![NPM](https://img.shields.io/npm/dm/ts-protoc-gen.svg)](https://www.npmjs.com/package/ts-protoc-gen)\n[![Apache 2.0 License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n# ts-protoc-gen\n\n> Protoc Plugin for generating TypeScript Declarations\n\nThis repository contains a [protoc](https://github.com/google/protobuf) plugin that generates TypeScript declarations\n(`.d.ts` files) that match the JavaScript output of `protoc --js_out=import_style=commonjs,binary`. This plugin can\nalso output service definitions as both `.js` and `.d.ts` files in the structure required by [grpc-web](https://github.com/improbable-eng/grpc-web), and as `.d.ts` files in the structure required by [grpc-node](https://github.com/grpc/grpc-node).\n\nThis plugin is tested and written using TypeScript 2.7.\n\n## Installation\n\n### npm\n\nAs a prerequisite, download or install `protoc` (the protocol buffer compiler) for your platform from the [github releases page](https://github.com/google/protobuf/releases) or via a package manager (ie: [brew](http://brewformulas.org/Protobuf), [apt](https://www.ubuntuupdates.org/pm/protobuf-compiler)).\n\nFor the latest stable version of the ts-protoc-gen plugin:\n\n```bash\nnpm install ts-protoc-gen\n```\n\nFor our latest build straight from master:\n\n```bash\nnpm install ts-protoc-gen@next\n```\n\n### bazel\n\nThe bazel rules have been moved to a separate project [here](https://github.com/Dig-Doug/rules_typescript_proto).\nThere is a\n[migration guide](https://github.com/Dig-Doug/rules_typescript_proto/blob/master/docs/migrating_from_ts_protoc_gen.md)\nfor existing users.\n\n## Contributing\n\nContributions are welcome! Please refer to [CONTRIBUTING.md](https://github.com/improbable-eng/ts-protoc-gen/blob/master/CONTRIBUTING.md) for more information.\n\n## Usage\n\nAs mentioned above, this plugin for `protoc` serves two purposes:\n\n1. Generating TypeScript Definitions for CommonJS modules generated by protoc\n2. Generating gRPC service clients for use with [grpc-web](https://github.com/improbable-eng/grpc-web) or [grpc-node](https://github.com/grpc/grpc-node).\n\n### Generating TypeScript Definitions for CommonJS modules generated by protoc\n\nBy default, protoc will generate ES5 code when the `--js_out` flag is used (see [javascript compiler documentation](https://github.com/google/protobuf/tree/master/js)). You have the choice of two module syntaxes, [CommonJS](https://nodejs.org/docs/latest-v8.x/api/modules.html) or [closure](https://developers.google.com/closure/library/docs/tutorial). This plugin (`ts-protoc-gen`) can be used to generate Typescript definition files (`.d.ts`) to provide type hints for CommonJS modules only.\n\nTo generate TypeScript definitions you must first configure `protoc` to use this plugin and then specify where you want the TypeScript definitions to be written to using the `--ts_out` flag.\n\n```bash\n# Path to this plugin\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nIn the above example, the `generated` folder will contain both `.js` and `.d.ts` files which you can reference in your TypeScript project to get full type completion and make use of ES6-style import statements, eg:\n\n```js\nimport { MyMessage } from \"../generated/users_pb\";\n\nconst msg = new MyMessage();\nmsg.setName(\"John Doe\");\n```\n\n### Generating gRPC Service Stubs for use with grpc-web\n\n[gRPC](https://grpc.io/) is a framework that enables client and server applications to communicate transparently, and makes it easier to build connected systems.\n\n[grpc-web](https://github.com/improbable-eng/grpc-web) is a comparability layer on both the server and client-side which allows gRPC to function natively in modern web-browsers.\n\nTo generate client-side service stubs from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=grpc-web` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=grpc-web:${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `pb_service.js` and `pb_service.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** Note that these modules require a CommonJS environment. If you intend to consume these stubs in a browser environment you will need to use a module bundler such as [webpack](https://webpack.js.org/).\n**Note** Both `js` and `d.ts` service files will be generated regardless of whether there are service definitions in the proto files.\n\n```js\nimport {\n  UserServiceClient,\n  GetUserRequest\n} from \"../generated/users_pb_service\";\n\nconst client = new UserServiceClient(\"https://my.grpc/server\");\nconst req = new GetUserRequest();\nreq.setUsername(\"johndoe\");\nclient.getUser(req, (err, user) => {\n  /* ... */\n});\n```\n\n### Generating gRPC Service Stubs for use with grpc-node\n\nThis plugin can generate `.d.ts` files for gRPC service definitions as required by [grpc-node](https://github.com/grpc/grpc-node).\n\nTo generate these declaration files from your protobuf files you must configure ts-protoc-gen to emit service definitions by passing the `service=grpc-node` param to the `--ts_out` flag, eg:\n\n```\n# Path to this plugin, Note this must be an abolsute path on Windows (see #15)\nPROTOC_GEN_TS_PATH=\"./node_modules/.bin/protoc-gen-ts\"\n\n# Path to the grpc_node_plugin\nPROTOC_GEN_GRPC_PATH=\"./node_modules/.bin/grpc_tools_node_protoc_plugin\"\n\n# Directory to write generated code to (.js and .d.ts files)\nOUT_DIR=\"./generated\"\n\nprotoc \\\n    --plugin=\"protoc-gen-ts=${PROTOC_GEN_TS_PATH}\" \\\n    --plugin=protoc-gen-grpc=${PROTOC_GEN_GRPC_PATH} \\\n    --js_out=\"import_style=commonjs,binary:${OUT_DIR}\" \\\n    --ts_out=\"service=grpc-node:${OUT_DIR}\" \\\n    --grpc_out=\"${OUT_DIR}\" \\\n    users.proto base.proto\n```\n\nThe `generated` folder will now contain both `_grpc_pb.js` and `_grpc_pb.d.ts` files which you can reference in your TypeScript project to make RPCs.\n\n**Note** This plugin does not generate the `_grpc_pb.js` files itself; those are generated by the protoc-gen-grpc plugin. This plugin only generates the `_grpc_pb.d.ts` files.\n\n#### Using `@grpc/grpc-js` instead of `grpc`\n\nAdd a mode parameter to generate files that import `@grpc/grpc-js` instead of `grpc`, for example:\n\n```\n--ts_out=\"service=grpc-node,mode=grpc-js:${OUT_DIR}\"\n```\n\nYou'll also need to specify the `grpc_js` option within the `--grpc_out` flag, for example:\n\n```\n--grpc_out=\"grpc_js:${OUT_DIR}\"\n```\n\nIf you're consuming the server interface types you'll need to use version `@grpc/grpc-js@1.2.0` or higher.\n\n## Examples\n\n- [Example output](https://github.com/improbable-eng/ts-protoc-gen/tree/master/examples) -- Code generated by `ts-protoc-gen`.\n- [Packaging the output as a node module](https://github.com/improbable-eng/ts-protoc-gen/issues/173) -- Example of how to use the generated code as a dependendecy of another module.\n\n## Gotchas\n\nBy default the google-protobuf library will use the JavaScript number type to store 64bit float and integer values; this can lead to overflow problems as you exceed JavaScript's `Number.MAX_VALUE`. To work around this, you should consider using the `jstype` annotation on any 64bit fields, ie:\n\n```proto\nmessage Example {\n  uint64 bigInt = 1 [jstype = JS_STRING];\n}\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"},"homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","_id":"ts-protoc-gen@0.15.1-pre.a71b34e","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-0wwdscE2XI2QRb+dBpsYHcIjflUmQbCRRwBtgpwvOrFicLA2bmHDhDaKwmDILBI77Db+XlM6/P24Oh0JmNAmgQ==","shasum":"4efddd0deaebe6dea344c36782e80de98bbb7931","tarball":"https://registry.npmjs.org/ts-protoc-gen/-/ts-protoc-gen-0.15.1-pre.a71b34e.tgz","fileCount":85,"unpackedSize":178569,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgiC7cCRA9TVsSAnZWagAA1jEP/2zzJ82yutYa1OKKtt8z\nWyvz96b/7NNsMx8gt8jJvYDgO9iVTkUTMbX+sX81KnUEQtK2wsmP2c6Z0gwr\nv7gENn84x9naH3NynrewWQBUayLbRjZuHZFFcZ9p0QgBjZtgE5mJ051XZ9ef\nTvxxTZj9qBZ/sHORP9EKjPNOLK/EB0CXeXSxfwRPAvP6LN41fBE9Pc4ySR5p\nNtbe68v2ytcJYoEnZRuoRdnIcfR71W1ZQ2/8qDnxTgIAndc0NnMR+vTYYPMj\nghPX+MVuIzFzGcFy2BJiwhkqseL8sQXv75H95yleW5fgd4bE/nh70I51BHWM\n40KZfQuNuGWkGyMGQsn7ATyA+KQvcBKe7n/ObeLTyqIn3fGG2G2cg1QzLurv\nAlQTwrVj9EkOj3+cTaiKXJbOKC0vTfb76dktpOmURjn2RwAoOqLEEV0v5PWn\n7+8pQNdPivJMckS4rY482SJ3KOkTmNIWdZMdfNOtVZ+20wVZjFL97vdODvl9\nfEBoL60YhyrqdO7jYCix79J0xaFAgVCeXBbg64lcO8FZPwEp5zN+7CBDgg98\nSJB32NL98LdNY9jM6SQNGy9H6JdbPOA+/iYRKtVMPRSiYU0jKonx9AaWD1Af\n6pXNkg1sgH6sz0eF57kAqU5zZs6cGRTVeDx0Tlw+kltFoYyWF3IPHzTjnn8e\nx1km\r\n=puWI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC2JepTV4DbM3CSb3SgTjTDPRs/f5oiAwqNbSNpH3eYNAIhAIMbEic76/DA9tlp6oiUPx7KTBf4Pcvq0ITbWXBMgv1y"}]},"_npmUser":{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"},"directories":{},"maintainers":[{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"},{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ts-protoc-gen_0.15.1-pre.a71b34e_1619537627794_0.6600946993988219"},"_hasShrinkwrap":false}},"readme":"","maintainers":[{"name":"marcuslongmuir","email":"marcus@marcuslongmuir.com"},{"name":"jonnyreeves","email":"npm@jonnyreeves.co.uk"}],"time":{"modified":"2022-06-27T22:16:40.538Z","created":"2017-03-26T10:55:21.419Z","0.1.0":"2017-03-26T10:55:21.419Z","0.1.1":"2017-03-26T11:13:52.666Z","0.2.0":"2017-04-01T20:07:29.921Z","0.2.1":"2017-04-01T20:12:36.687Z","0.2.2":"2017-04-27T12:01:31.858Z","0.3.0":"2017-05-01T15:45:48.971Z","0.3.1":"2017-05-09T10:12:26.778Z","0.3.2":"2017-06-25T20:22:51.720Z","0.3.3":"2017-07-30T21:28:47.178Z","0.4.0":"2017-08-16T14:48:40.426Z","0.5.0":"2018-03-26T20:53:00.110Z","0.5.1":"2018-03-27T10:29:17.618Z","0.5.2":"2018-03-27T10:31:19.415Z","0.6.0":"2018-04-19T06:22:52.602Z","0.7.0-pre":"2018-05-25T08:40:46.623Z","0.7.1-pre":"2018-05-26T06:46:39.948Z","0.7.1-pre.44987dc":"2018-05-26T07:21:50.649Z","0.7.0":"2018-05-26T14:03:22.798Z","0.7.1":"2018-05-26T14:20:18.662Z","0.7.2":"2018-05-26T14:29:58.120Z","0.7.3":"2018-05-26T14:34:17.665Z","0.7.4-pre.f79924d":"2018-05-26T14:38:21.049Z","0.7.4-pre.eabf953":"2018-05-26T14:38:59.517Z","0.7.4-pre.4911ace":"2018-05-26T14:42:13.972Z","0.7.4-pre.7247cc3":"2018-05-26T18:47:16.527Z","0.7.4-pre.c79cabb":"2018-05-26T18:51:27.927Z","0.7.4-pre":"2018-05-28T19:31:13.572Z","0.7.4-pre.54d261f":"2018-05-30T19:12:07.714Z","0.7.4-pre.05c52b8":"2018-06-10T17:34:50.189Z","0.7.4-pre.53aa49c":"2018-06-13T18:56:31.645Z","0.7.5-pre.64914b2":"2018-07-18T14:34:03.706Z","0.7.6":"2018-07-18T20:43:07.979Z","0.7.7-pre.50bb30c":"2018-07-18T20:44:56.044Z","0.7.7-pre.24fbad6":"2018-09-01T07:01:35.143Z","0.7.7-pre.5959599":"2018-09-06T12:17:49.914Z","0.7.7-pre.1d7e310":"2018-09-08T10:02:42.727Z","0.7.7-pre.5b06c73":"2018-09-08T10:03:04.252Z","0.7.7-pre.687bcc7":"2018-09-12T17:19:39.579Z","0.7.7-pre.67e0c93":"2018-09-13T08:39:16.413Z","0.7.7-pre.8ca48fe":"2018-09-24T08:03:24.969Z","0.7.7-pre.34d3d68":"2018-10-13T08:35:59.281Z","0.7.7-pre":"2018-10-14T09:27:23.871Z","0.7.7-pre.d9ec484":"2018-10-14T11:28:41.591Z","0.7.7":"2018-10-14T11:35:02.329Z","0.7.8-pre":"2018-10-14T13:54:19.828Z","0.7.8-pre.b7267ea":"2018-10-16T14:10:18.811Z","0.7.8-pre.7846e2f":"2018-10-16T20:00:59.873Z","0.7.8-pre.51f57ea":"2018-10-16T20:04:30.985Z","0.7.8-pre.217169b":"2018-10-20T21:45:27.600Z","0.7.8-pre.b4e921a":"2018-11-12T13:19:58.505Z","0.8.1-pre.a7b6422":"2018-11-12T13:27:38.152Z","0.8.0":"2018-11-12T13:34:24.972Z","0.8.1-pre.14d69f6":"2018-11-29T19:16:13.855Z","0.8.1-pre.f127046":"2018-12-01T22:25:18.261Z","0.8.1-pre.dd6273b":"2019-01-12T17:23:51.236Z","0.8.1-pre.9c8f487":"2019-01-12T17:25:00.961Z","0.9.0":"2019-01-12T17:31:15.330Z","0.9.1-pre.50abb56":"2019-01-12T17:33:28.429Z","0.9.1-pre.7f532e5":"2019-03-30T07:13:43.361Z","0.9.1-pre.c8a573d":"2019-04-02T18:33:57.206Z","0.9.1-pre.901b08e":"2019-04-03T12:09:25.693Z","0.9.1-pre.aa468e9":"2019-04-04T07:13:16.273Z","0.9.1-pre.63a2845":"2019-04-04T10:27:05.235Z","0.9.1-pre.cdb79ec":"2019-04-10T18:01:06.212Z","0.9.1-pre.cbe7398":"2019-04-13T19:04:09.071Z","0.9.1-pre.ad36364":"2019-05-15T08:58:05.945Z","0.10.0":"2019-05-15T09:04:07.179Z","0.10.1-pre.e8c15bc":"2019-05-15T09:17:54.006Z","0.10.1-pre.6d22676":"2019-05-15T09:48:59.438Z","0.10.1-pre.78cf7ae":"2019-05-15T09:50:11.232Z","0.10.1-pre.987f176":"2019-05-15T09:55:07.178Z","0.10.1-pre.cf38460":"2019-06-13T22:00:41.557Z","0.10.1-pre.7b144ed":"2019-06-13T22:03:49.155Z","0.10.1-pre.cbcd353":"2019-06-27T15:16:24.055Z","0.10.1-pre.2f98b5c":"2019-08-05T09:55:04.411Z","0.10.1-pre.e3d1c32":"2019-08-05T10:01:16.346Z","0.10.1-pre.c511ff3":"2019-08-14T06:54:25.487Z","0.10.1-pre.7a65c0d":"2019-08-16T07:46:15.306Z","0.10.1-pre.005b479":"2019-08-29T21:44:48.692Z","0.10.1-pre.7a3d3c8":"2019-08-29T21:49:26.903Z","0.10.1-pre.90f1ac5":"2019-08-30T05:50:08.924Z","0.10.1-pre.252fec7":"2019-08-30T05:51:41.675Z","0.10.1-pre.49c229b":"2019-08-30T07:38:15.018Z","0.11.0":"2019-08-30T09:49:54.703Z","0.11.1-pre.dc70c35":"2019-10-22T08:46:05.273Z","0.12.0":"2019-10-22T19:41:21.891Z","0.12.1-pre.46e6630":"2019-10-22T19:41:36.335Z","0.12.1-pre.a78a914":"2019-10-22T19:48:13.942Z","0.12.1-pre.abb949e":"2020-05-26T13:56:47.479Z","0.12.1-pre.3266132":"2020-05-27T13:03:27.836Z","0.12.1-pre.6383416":"2020-09-10T19:52:52.140Z","0.13.0":"2020-09-11T09:14:17.311Z","0.13.1-pre.2e080f3":"2020-12-10T20:29:58.819Z","0.14.0":"2020-12-15T14:19:17.547Z","0.14.1-pre.02149e6":"2020-12-15T15:09:51.819Z","0.14.1-pre.e680d69":"2020-12-15T17:35:08.383Z","0.14.1-pre.d492bcc":"2021-03-25T15:02:03.679Z","0.14.1-pre.fd6e3a0":"2021-04-24T09:00:58.131Z","0.14.1-pre.77d9ada":"2021-04-26T22:29:18.373Z","0.15.0":"2021-04-27T12:53:43.892Z","0.15.1-pre.a71b34e":"2021-04-27T15:33:47.953Z"},"keywords":["protobuf","protoc","typescript","ts","grpc","service","proto3"],"repository":{"type":"git","url":"git+https://github.com/improbable-eng/ts-protoc-gen.git"},"author":{"name":"Improbable"},"license":"Apache-2.0","readmeFilename":"","homepage":"https://github.com/improbable-eng/ts-protoc-gen#readme","bugs":{"url":"https://github.com/improbable-eng/ts-protoc-gen/issues"}}