{"_id":"@arcjet-vendor/connectrpc-connect-node","_rev":"3-bed6148f692ae83388a92506b36b1559","name":"@arcjet-vendor/connectrpc-connect-node","dist-tags":{"latest":"1.7.1"},"versions":{"1.7.1":{"name":"@arcjet-vendor/connectrpc-connect-node","version":"1.7.1","license":"Apache-2.0","_id":"@arcjet-vendor/connectrpc-connect-node@1.7.1","maintainers":[{"name":"quinn-arcjet","email":"quinn@arcjet.com"}],"homepage":"https://github.com/connectrpc/connect-es#readme","bugs":{"url":"https://github.com/connectrpc/connect-es/issues"},"dist":{"shasum":"3bac921a7a36990fbc0a437e5391308015db30fb","tarball":"https://registry.npmjs.org/@arcjet-vendor/connectrpc-connect-node/-/connectrpc-connect-node-1.7.1.tgz","fileCount":55,"integrity":"sha512-mvzAq/Cuv19xVmybMVuWBLgfsOo7YGO+dGtPnCN7HdT2/rsBcBHscjSy8FmNgsonuDTmMyM1ccE7/a3Nzk6tiw==","signatures":[{"sig":"MEUCIQCqPoHgW3SEJmkDB8pLs7scts8qO5qg5D3eq8d0HzmNcQIgRx/0pPppgBngRcTaSuHrDcgGnTnoQM1DeCYCPu9mzO8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":213933},"main":"./dist/cjs/index.js","type":"module","types":"./dist/cjs/index.d.ts","engines":{"node":">=16.0.0"},"exports":{".":{"import":"./dist/esm/index.js","require":"./dist/cjs/index.js"}},"gitHead":"f7eddb5136ff9cfd48b03377925b3053f848e09c","scripts":{"attw":"attw --pack","lint":"eslint --max-warnings 0 .","test":"jasmine --config=jasmine.json","build":"npm run build:cjs && npm run build:esm","format":"prettier --write --ignore-unknown '.' '!dist'","prebuild":"rm -rf ./dist/*","build:cjs":"tsc --project tsconfig.build.json --module commonjs --moduleResolution node10 --verbatimModuleSyntax false --outDir ./dist/cjs --declaration --declarationDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'","build:esm":"tsc --project tsconfig.build.json --outDir ./dist/esm --declaration --declarationDir ./dist/esm","license-header":"license-header","conformance:client":"tsc --noEmit && connectconformance --mode client --conf ./conformance/conformance-node.yaml -v -- tsx ./conformance/client.ts","conformance:server":"tsc --noEmit && connectconformance --mode server --conf ./conformance/conformance-node.yaml -v -- tsx ./conformance/server.ts"},"_npmUser":{"name":"quinn-arcjet","email":"quinn@arcjet.com"},"repository":{"url":"git+https://github.com/connectrpc/connect-es.git","type":"git","directory":"packages/connect-node"},"_npmVersion":"10.8.2","description":"> ⚠️ **Vendored fork**   > Maintained by Arcjet for internal/product use. May diverge from upstream.","directories":{},"_nodeVersion":"18.20.8","dependencies":{"undici":"^5.28.4"},"_hasShrinkwrap":false,"devDependencies":{"jasmine":"^5.2.0","@types/jasmine":"^5.0.0","@arcjet-vendor/connectrpc-connect-conformance":"^1.7.1"},"peerDependencies":{"@bufbuild/protobuf":"^1.10.0","@arcjet-vendor/connectrpc-connect":"1.7.1"},"_npmOperationalInternal":{"tmp":"tmp/connectrpc-connect-node_1.7.1_1769558351136_0.8117327027412291","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."}},"time":{"created":"2026-01-27T23:59:11.040Z","modified":"2026-02-06T01:49:31.368Z","1.7.1":"2026-01-27T23:59:11.296Z"},"bugs":{"url":"https://github.com/connectrpc/connect-es/issues"},"license":"Apache-2.0","homepage":"https://github.com/connectrpc/connect-es#readme","repository":{"url":"git+https://github.com/connectrpc/connect-es.git","type":"git","directory":"packages/connect-node"},"description":"> ⚠️ **Vendored fork**   > Maintained by Arcjet for internal/product use. May diverge from upstream.","maintainers":[{"name":"davidmytton","email":"david@arcjet.com"},{"name":"quinn-arcjet","email":"quinn@arcjet.com"}],"readme":"> ⚠️ **Vendored fork**  \n> Maintained by Arcjet for internal/product use. May diverge from upstream.\n\n# @arcjet-vendor/connectrpc-connect-node\n\nConnect is a family of libraries for building and consuming APIs on different languages and platforms, and\n[@arcjet-vendor/connectrpc-connect](https://www.npmjs.com/package/@arcjet-vendor/connectrpc-connect) brings type-safe APIs with Protobuf to\nTypeScript.\n\n`@arcjet-vendor/connectrpc-connect-node` provides the following adapters for Node.js:\n\n### createConnectTransport()\n\nLets your clients running on Node.js talk to a server with the Connect protocol:\n\n```diff\nimport { createClient } from \"@arcjet-vendor/connectrpc-connect\";\n+ import { createConnectTransport } from \"@arcjet-vendor/connectrpc-connect-node\";\nimport { ElizaService } from \"./gen/eliza_connect.js\";\n\n+ // A transport for clients using the Connect protocol with Node.js `http` module\n+ const transport = createConnectTransport({\n+   baseUrl: \"https://demo.connectrpc.com\",\n+   httpVersion: \"1.1\"\n+ });\n\nconst client = createClient(ElizaService, transport);\nconst { sentence } = await client.say({ sentence: \"I feel happy.\" });\nconsole.log(sentence) // you said: I feel happy.\n```\n\n### createGrpcTransport()\n\nLets your clients running on Node.js talk to a server with the gRPC protocol:\n\n```diff\nimport { createClient } from \"@arcjet-vendor/connectrpc-connect\";\n+ import { createGrpcTransport } from \"@arcjet-vendor/connectrpc-connect-node\";\nimport { ElizaService } from \"./gen/eliza_connect.js\";\n\n+ // A transport for clients using the gRPC protocol with Node.js `http2` module\n+ const transport = createGrpcTransport({\n+   baseUrl: \"https://demo.connectrpc.com\",\n+   httpVersion: \"2\"\n+ });\n\nconst client = createClient(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 on Node.js talk to a server with the gRPC-web protocol:\n\n```diff\nimport { createClient } from \"@arcjet-vendor/connectrpc-connect\";\n+ import { createGrpcWebTransport } from \"@arcjet-vendor/connectrpc-connect-node\";\nimport { ElizaService } from \"./gen/eliza_connect.js\";\n\n+ // A transport for clients using the Connect protocol with Node.js `http` module\n+ const transport = createGrpcWebTransport({\n+   baseUrl: \"https://demo.connectrpc.com\",\n+   httpVersion: \"1.1\"\n+ });\n\nconst client = createClient(ElizaService, transport);\nconst { sentence } = await client.say({ sentence: \"I feel happy.\" });\nconsole.log(sentence) // you said: I feel happy.\n```\n\n### connectNodeAdapter()\n\nRun your Connect RPCs on the Node.js `http`, `https`, or `http2` modules.\n\n```ts\n// connect.ts\nimport { ConnectRouter } from \"@arcjet-vendor/connectrpc-connect\";\n\nexport default function (router: ConnectRouter) {\n  // implement rpc Say(SayRequest) returns (SayResponse)\n  router.rpc(ElizaService, ElizaService.methods.say, async (req) => ({\n    sentence: `you said: ${req.sentence}`,\n  }));\n}\n```\n\n```diff\n// server.ts\nimport * as http2 from \"http2\";\n+ import routes from \"connect\";\n+ import { connectNodeAdapter } from \"@arcjet-vendor/connectrpc-connect-node\";\n\nhttp2.createServer(\n+ connectNodeAdapter({ routes }) // responds with 404 for other requests\n).listen(8080);\n```\n\nWith that server running, you can make requests with any gRPC, gRPC-Web, or Connect client.\n\n`buf curl` with the gRPC protocol:\n\n```bash\nbuf curl --schema buf.build/connectrpc/eliza \\\n  --protocol grpc --http2-prior-knowledge \\\n  -d '{\"sentence\": \"I feel happy.\"}' \\\n  http://localhost:8080/connectrpc.eliza.v1.ElizaService/Say\n```\n\n`curl` with the Connect protocol:\n\n```bash\ncurl \\\n    --header \"Content-Type: application/json\" \\\n    --data '{\"sentence\": \"I feel happy.\"}' \\\n     --http2-prior-knowledge \\\n    http://localhost:8080/connectrpc.eliza.v1.ElizaService/Say\n```\n\nNode.js with the gRPC protocol:\n\n```ts\nimport { createClient } from \"@arcjet-vendor/connectrpc-connect\";\nimport { createGrpcTransport } from \"@arcjet-vendor/connectrpc-connect-node\";\nimport { ElizaService } from \"./gen/eliza_connect.js\";\n\nconst transport = createGrpcTransport({\n  baseUrl: \"http://localhost:8080\",\n  httpVersion: \"2\",\n});\n\nconst client = createClient(ElizaService, transport);\nconst { sentence } = await client.say({ sentence: \"I feel happy.\" });\nconsole.log(sentence); // you said: I feel happy.\n```\n\nA client for the web browser actually looks identical to this example - it would\nsimply use `createConnectTransport` from [@arcjet-vendor/connectrpc-connect-web](https://www.npmjs.com/package/@arcjet-vendor/connectrpc-connect-web)\ninstead.\n\n## Getting started\n\nTo get started with Connect, head over to the [docs](https://connectrpc.com/docs/node/getting-started)\nfor a tutorial, or take a look at [our example](https://github.com/connectrpc/connect-es/tree/main/packages/example).\n","readmeFilename":"README.md"}