{"_id":"@apachedubbo/dubbo-web","name":"@apachedubbo/dubbo-web","dist-tags":{"alpha":"3.0.0-alpha","latest":"3.0.0-alpha"},"versions":{"3.0.0-alpha":{"name":"@apachedubbo/dubbo-web","version":"3.0.0-alpha","license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/apache/dubbo-js.git","directory":"packages/dubbo-web"},"sideEffects":false,"scripts":{"clean":"rm -rf ./dist/cjs/* ./dist/esm/* ./dist/types/*","build":"npm run build:cjs && npm run build:esm+types","build:cjs":"tsc --project tsconfig.json --module commonjs --outDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'","build:esm+types":"tsc --project tsconfig.json --module ES2015 --verbatimModuleSyntax --outDir ./dist/esm --declaration --declarationDir ./dist/types"},"main":"./dist/cjs/index.js","type":"module","types":"./dist/types/index.d.ts","exports":{"types":"./dist/types/index.d.ts","import":"./dist/esm/index.js","require":"./dist/cjs/index.js"},"dependencies":{"@apachedubbo/dubbo":"3.0.0-alpha"},"peerDependencies":{"@bufbuild/protobuf":"^1.2.1"},"gitHead":"dd9eba1b7b4c5d306fc8275537694cca02ad7975","description":"Dubbo is a family of libraries for building and consuming APIs on different languages and platforms. [@apachedubbo/dubbo](https://www.npmjs.com/package/@apachedubbo/dubbo) brings type-safe APIs with Protobuf to TypeScript.","bugs":{"url":"https://github.com/apache/dubbo-js/issues"},"homepage":"https://github.com/apache/dubbo-js#readme","_id":"@apachedubbo/dubbo-web@3.0.0-alpha","_nodeVersion":"18.16.1","_npmVersion":"9.5.1","dist":{"integrity":"sha512-4FZomFkSfmsK+ArET+POVH8SppjluYUDpoEiOKJxGVIOgYN7ViZbCT6cwP37StDRm8hMZgmWos8zKOwj5ABR+A==","shasum":"16b08ba018ad4ca99c25c8a935c86b602295a5f8","tarball":"https://registry.npmjs.org/@apachedubbo/dubbo-web/-/dubbo-web-3.0.0-alpha.tgz","fileCount":15,"unpackedSize":51628,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDFUvSdSQRNZoxSO1ZRvg/uT9rbfNGq5fu89ajE13kRPgIgEI8yvdaI6ExeMWRqDoYa/uKBwL4OsnSRzXSYoeNhJpc="}]},"_npmUser":{"name":"jianyi-gronk","email":"jianyi_gronk@163.com"},"directories":{},"maintainers":[{"name":"jianyi-gronk","email":"jianyi_gronk@163.com"},{"name":"apache-dubbo","email":"dubbo.alibaba@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dubbo-web_3.0.0-alpha_1694061565436_0.37041667999490313"},"_hasShrinkwrap":false}},"time":{"created":"2023-09-07T04:39:25.316Z","3.0.0-alpha":"2023-09-07T04:39:25.597Z","modified":"2023-09-07T04:39:25.933Z"},"maintainers":[{"name":"jianyi-gronk","email":"jianyi_gronk@163.com"},{"name":"apache-dubbo","email":"dubbo.alibaba@gmail.com"}],"description":"Dubbo is a family of libraries for building and consuming APIs on different languages and platforms. [@apachedubbo/dubbo](https://www.npmjs.com/package/@apachedubbo/dubbo) brings type-safe APIs with Protobuf to TypeScript.","homepage":"https://github.com/apache/dubbo-js#readme","repository":{"type":"git","url":"git+https://github.com/apache/dubbo-js.git","directory":"packages/dubbo-web"},"bugs":{"url":"https://github.com/apache/dubbo-js/issues"},"license":"Apache-2.0","readme":"# @apachedubbo/dubbo-web\n\nDubbo is a family of libraries for building and consuming APIs on different languages and platforms.\n[@apachedubbo/dubbo](https://www.npmjs.com/package/@apachedubbo/dubbo) brings type-safe APIs with Protobuf to\nTypeScript.\n\n`@apachedubbo/dubbo-web` provides the following adapters for web browsers, and any other platform that has\nthe fetch API on board:\n\n### createDubboTransport()\n\nLets your clients running in the web browser talk to a server with the Dubbo protocol:\n\n```diff\nimport { createPromiseClient } from \"@apachedubbo/dubbo\";\n+ import { createDubboTransport } from \"@apachedubbo/dubbo-web\";\nimport { ElizaService } from \"./gen/eliza_dubbo.js\";\n\n+ // A transport for clients using the Dubbo protocol with fetch()\n+ const transport = createDubboTransport({\n+   baseUrl: \"https://demo.connect.build\",\n+ });\n\nconst client = createPromiseClient(ElizaService, transport);\nconst { sentence } = await client.say({ sentence: \"I feel happy.\" });\nconsole.log(sentence) // you said: I feel happy.\n```\n\n### createGrpcWebTransport()\n\nLets your clients running in the web browser talk to a server with the gRPC-web protocol:\n\n```diff\nimport { createPromiseClient } from \"@apachedubbo/dubbo\";\n+ import { createGrpcWebTransport } from \"@apachedubbo/dubbo-web\";\nimport { ElizaService } from \"./gen/eliza_dubbo.js\";\n\n+ // A transport for clients using the Dubbo protocol with fetch()\n+ const transport = createGrpcWebTransport({\n+   baseUrl: \"https://demo.connect.build\",\n+ });\n\nconst client = createPromiseClient(ElizaService, transport);\nconst { sentence } = await client.say({ sentence: \"I feel happy.\" });\nconsole.log(sentence) // you said: I feel happy.\n```\n\n## Getting started\n\nTo get started with Dubbo, head over to the [docs](https://cn.dubbo.apache.org/zh-cn/overview/quickstart/)\nfor a tutorial, or take a look at [our example](https://github.com/apache/dubbo-js/tree/dubbo3/example/).\n\nDubbo plays nice with Vue, Svelte, Remix, Next.js, Angular and many others. Take a look at\n[our examples](https://github.com/apache/dubbo-js/tree/dubbo3/example) for various frameworks.\n","readmeFilename":"README.md"}