{"_id":"@curiostack/grpc-web-temporary","_rev":"1-cbffd8f4976bc6bf522cd52f06fea443","name":"@curiostack/grpc-web-temporary","dist-tags":{"latest":"1.0.4-alpha.1"},"versions":{"1.0.4-alpha.1":{"name":"@curiostack/grpc-web-temporary","version":"1.0.4-alpha.1","author":{"name":"Google Inc."},"description":"gRPC-Web Client Runtime Library","homepage":"https://grpc.io/","repository":{"type":"git","url":"https://github.com/grpc/grpc-web.git"},"bugs":{"url":"https://github.com/grpc/grpc-web/issues"},"main":"index.js","typings":"index.d.ts","scripts":{"build":"node scripts/build.js","prepare":"npm run build && require-self","prepublishOnly":"npm run build","test":"mocha --timeout 8000 \"./test/**/*_test.js\""},"license":"Apache-2.0","devDependencies":{"command-exists":"^1.2.7","google-closure-compiler":"^20180716.0.0","google-protobuf":"^3.6.1","mocha":"^5.2.0","mock-xmlhttprequest":"^2.0.0","require-self":"^0.2.1","typescript":"^3.2.1"},"dependencies":{"google-closure-library":"^20190301.0.0"},"_id":"@curiostack/grpc-web-temporary@1.0.4-alpha.1","dist":{"shasum":"2842a9b3d03d5dec728afa8d9208d820e25f63b1","integrity":"sha512-9ql8YDk/dv0rbJ5TB0J4VEWMy9DzFGGAfF0lEYWiTHcuVhUsu1EXDXTg4domb/IU72+fPpc0qYpKmvs8JpMUzA==","tarball":"https://registry.npmjs.org/@curiostack/grpc-web-temporary/-/grpc-web-temporary-1.0.4-alpha.1.tgz","fileCount":5,"unpackedSize":35375,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcj4J/CRA9TVsSAnZWagAA9fkP/A4tgX5fRg91DrPVnaLA\nvaNrEF6+4mKc7W0RgstodzLJw7dsipZaRc2DOAhfEp2Ng12NkBjMJLVYNeq5\nmerAqDVd8E1Hu7E0x7Iqqy3A2a1kAe8OAM7z0j7nV3JjIHQ1YW6PKZijP4mw\ncbrhG+jP6Cb3zVWc1qF0ie73gXQIu1FBZc6EZzqSrjV5mPHMgnrAM8ylJbVH\n0c8KegUEr/07V5ZdXspjYAIjtdDHe61SIRY616zrC9kUVLVsaxrsmB1Hu+4g\n4VlHRb+hW73WEeO+M997Xzy+TM1nXDyxSsyD2EnUk++ynKbJefoc524GCSqY\nCQETOqVE29Ei7ryyP4tdFtq6jmetuQYfJidxe14f3i5Mm+vp/t3gR0pBxYzU\nF01XAy14Tr4qn4Anp0y+BZxeBR1KeHqVKBFtBywrJhYknMTFf6XKlUqF0e1t\nXa9ImJ7Hl5/E8K3nsoUf3JHoJ3v13/wtyATYltc327T65VKMfBdAoCvWM0Fe\nFJacjAxdhMOt8Q+s31xa/AsFGL6+YZqXpKzdGFloWZbupnzakaqOFC/wB6Nk\nJtVYEbjBYNesXMNfyvJEWGGLM6WP/m4+MK6eUbx+xyXjcFxFQ6ULlIgRiyGY\ndpNnFhc/ZjpXb0rJ6YlNFUNcKIb10bGt8QVbLCBGJcv2vW8knuda1sTEea/F\ngIDM\r\n=cu8F\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDR86bG3DmN5ss8X1r59Z+3Jike0Vhp1VhxVG4ha1phbwIhAKZCxG1A8qimW85rB8kAO/7iqdq9XSrQVla5FJ1CIKv3"}]},"maintainers":[{"name":"chokoswitch","email":"choko@curioswitch.org"}],"_npmUser":{"name":"chokoswitch","email":"choko@curioswitch.org"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/grpc-web-temporary_1.0.4-alpha.1_1552908926590_0.6526332383901727"},"_hasShrinkwrap":false}},"time":{"created":"2019-03-18T11:35:26.422Z","1.0.4-alpha.1":"2019-03-18T11:35:26.862Z","modified":"2022-04-05T02:19:05.805Z"},"maintainers":[{"name":"chokoswitch","email":"choko@curioswitch.org"}],"description":"gRPC-Web Client Runtime Library","homepage":"https://grpc.io/","repository":{"type":"git","url":"https://github.com/grpc/grpc-web.git"},"author":{"name":"Google Inc."},"bugs":{"url":"https://github.com/grpc/grpc-web/issues"},"license":"Apache-2.0","readme":"# gRPC-Web Client Runtime Library\n\ngRPC-Web provides a Javascript library that lets browser clients access a gRPC\nservice. You can find out much more about gRPC in its own\n[website](https://grpc.io).\n\nThe current release is a Beta release, and we expect to announce\nGeneral-Availability by Oct. 2018.\n\ngRPC-Web clients connect to gRPC services via a special gateway proxy: the\ncurrent version of the library uses [Envoy](https://www.envoyproxy.io/) by\ndefault, in which gRPC-Web support is built-in. \n\nIn the future, we expect gRPC-Web to be supported in language-specific Web\nframeworks, such as Python, Java, and Node. See the\n[roadmap](https://github.com/grpc/grpc-web/blob/master/ROADMAP.md) doc.\n\n\n## Quick Start\n\nThis example is using the `echo.proto` file from the\n[Echo Example](https://github.com/grpc/grpc-web/tree/master/net/grpc/gateway/examples/echo).\n\n 1. Add `grpc-web` as a dependency using `npm`.\n\n```sh\n$ npm i grpc-web\n```\n\n 2. Download `protoc` and the `protoc-gen-grpc-web` protoc plugin.\n\nYou can download the `protoc` binary from the official\n[protocolbuffers](https://github.com/protocolbuffers/protobuf/releases)\nrelease page.\n\nYou can download the `protoc-gen-grpc-web` protoc plugin from our Github\n[release](https://github.com/grpc/grpc-web/releases) page.\n\n\nMake sure they are both executable and are discoverable from your PATH.\n\nFor example, in MacOS, you can do:\n\n```\n$ sudo mv ~/Downloads/protoc-gen-grpc-web-1.0.3-darwin-x86_64 \\\n  /usr/local/bin/protoc-gen-grpc-web\n$ chmod +x /usr/local/bin/protoc-gen-grpc-web\n```\n\n\n 3. Generate your proto messages and the service client stub classes with\n`protoc` and the `protoc-gen-grpc-web` plugin. You can set the\n`import_style=commonjs` option for both `--js_out` and `--grpc-web_out`.\n\n```sh\n$ protoc -I=$DIR echo.proto \\\n--js_out=import_style=commonjs:generated \\\n--grpc-web_out=import_style=commonjs,mode=grpcwebtext:generated\n```\n\n 4. Start using your generated client!\n\n```js\nconst {EchoServiceClient} = require('./generated/echo_grpc_web_pb.js');\nconst {EchoRequest} = require('./generated/echo_pb.js');\n\nconst client = new EchoServiceClient('localhost:8080');\n\nconst request = new EchoRequest();\nrequest.setMessage('Hello World!');\n\nconst metadata = {'custom-header-1': 'value1'};\n\nclient.echo(request, metadata, (err, response) => {\n  // ...\n});\n```\n\n\n## What's Next\n\nTo complete the example, you need to run a proxy that understands the\n[gRPC-Web protocol](https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-WEB.md#protocol-differences-vs-grpc-over-http2)\nbetween your browser client and your gRPC service. The default proxy currently\nis [Envoy](https://www.envoyproxy.io/). Please visit our\n[Github repo](https://github.com/grpc/grpc-web) for more information.\n\nHere's a quick way to get started!\n\n```sh\n$ git clone https://github.com/grpc/grpc-web\n$ cd grpc-web\n$ docker-compose up node-server envoy commonjs-client\n```\n\nOpen a browser tab, and go to:\n\n```\nhttp://localhost:8081/echotest.html\n```\n\n## TypeScript Support\n\nThe `grpc-web` module can now be imported as a TypeScript module. This is\ncurrently an experimental feature. Any feedback welcome!\n\nWhen using the `protoc-gen-grpc-web` protoc plugin, mentioned above, pass in\neither:\n\n - `import_style=commonjs+dts`: existing CommonJS style stub + `.d.ts` typings\n - `import_style=typescript`: full TypeScript output\n\n\n```ts\nimport * as grpcWeb from 'grpc-web';\nimport {EchoServiceClient} from './echo_grpc_web_pb';\nimport {EchoRequest, EchoResponse} from './echo_pb';\n\nconst echoService = new EchoServiceClient('http://localhost:8080', null, null);\n\nconst request = new EchoRequest();\nrequest.setMessage('Hello World!');\n\nconst call = echoService.echo(request, {'custom-header-1': 'value1'},\n  (err: grpcWeb.Error, response: EchoResponse) => {\n    console.log(response.getMessage());\n  });\ncall.on('status', (status: grpcWeb.Status) => {\n  // ...\n});\n```\n\nSee a full TypeScript example\n[here](https://github.com/grpc/grpc-web/blob/master/net/grpc/gateway/examples/echo/ts-example/client.ts).\n\n\n## Run Tests\n\nPre-requisites:\n - `protoc`\n - `protoc-gen-grpc-web` plugin\n\n\n```sh\n$ npm test\n```\n","readmeFilename":"README.md"}