{"_id":"@avyaya/zrpc-core","_rev":"3-8b9959d5021281992aee2d2dd8b93026","name":"@avyaya/zrpc-core","dist-tags":{"latest":"0.2.2"},"versions":{"0.2.0":{"name":"@avyaya/zrpc-core","version":"0.2.0","keywords":["grpc","rpc","zod","typescript","typesafe"],"author":{"name":"Banisetti Naveen","email":"baninkumar@gmail.com"},"license":"MIT","_id":"@avyaya/zrpc-core@0.2.0","maintainers":[{"name":"baninaveenkr","email":"baninkumar@gmail.com"}],"homepage":"https://github.com/baninaveen/zrpc#readme","bugs":{"url":"https://github.com/baninaveen/zrpc/issues"},"dist":{"shasum":"934156ac28aa4baba0a6541a6aac98add3ff5abf","tarball":"https://registry.npmjs.org/@avyaya/zrpc-core/-/zrpc-core-0.2.0.tgz","fileCount":5,"integrity":"sha512-aaI/GSto9IMB/GxakLrnQaHdHRA9zZGE73yumn9kEo86m/HAG3g4jN00Xe59mn+XysTrvDAvaHmPKoRH2I1niw==","signatures":[{"sig":"MEQCIDBxh6ljtJFnoUnP0o5KtYp/dglTzMAF2gLDd/38gdoUAiA/XrpLCww07GJf9F37luexoZuOmDCNe+Bh1sA8ZFEoGw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":18468},"main":"./dist/index.cjs","type":"module","_from":"file:avyaya-zrpc-core-0.2.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"private":false,"scripts":{"dev":"pnpm build --watch","lint":"eslint src/","build":"tsup src/index.ts --format esm,cjs --dts --clean"},"_npmUser":{"name":"baninaveenkr","email":"baninkumar@gmail.com"},"_resolved":"C:\\Users\\pujab\\AppData\\Local\\Temp\\322bb45adf47ef7b48f9069c872c8e57\\avyaya-zrpc-core-0.2.0.tgz","_integrity":"sha512-aaI/GSto9IMB/GxakLrnQaHdHRA9zZGE73yumn9kEo86m/HAG3g4jN00Xe59mn+XysTrvDAvaHmPKoRH2I1niw==","repository":{"url":"git+https://github.com/baninaveen/zrpc.git","type":"git"},"_npmVersion":"10.8.1","description":"A type-safe gRPC framework for Node.js, built with Zod.","directories":{},"_nodeVersion":"20.16.0","dependencies":{"zod":"^4.1.6","@grpc/grpc-js":"^1.13.4","@grpc/proto-loader":"^0.8.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","typescript":"^5.9.2","@avyaya/zrpc-eslint-config":"1.0.0","@avyaya/zrpc-typescript-config":"1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/zrpc-core_0.2.0_1757696456931_0.989989071336115","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@avyaya/zrpc-core","version":"0.2.1","keywords":["grpc","rpc","zod","typescript","typesafe"],"author":{"name":"Banisetti Naveen","email":"baninkumar@gmail.com"},"license":"MIT","_id":"@avyaya/zrpc-core@0.2.1","maintainers":[{"name":"baninaveenkr","email":"baninkumar@gmail.com"}],"homepage":"https://github.com/baninaveen/zrpc#readme","bugs":{"url":"https://github.com/baninaveen/zrpc/issues"},"dist":{"shasum":"42b35702a2706ccbf8f391410f55728e3735f9fe","tarball":"https://registry.npmjs.org/@avyaya/zrpc-core/-/zrpc-core-0.2.1.tgz","fileCount":6,"integrity":"sha512-gUkVLEzFRXMhZSt+czcZp0V8t3KwYMHv8zbOrGkvDx9L7YkdgOKrPsBDFoFW2UuP70iHkEgQafurIGCH2y+98A==","signatures":[{"sig":"MEUCICKqNy4DE2KaUjaQvl3GCl9WE3gi38gKlCwTWb4L49cEAiEAjP87ompyvwCAYc/L/nBP+ysPPxrNnRVCzO0acVdUs98=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":21875},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.mjs","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/index.cjs"}},"gitHead":"4d3d270ce73d1945f56f54a3b53c05899a2a2eac","private":false,"scripts":{"dev":"pnpm build --watch","lint":"eslint src/","build":"tsup src/index.ts --format esm,cjs --dts --clean"},"_npmUser":{"name":"baninaveenkr","email":"baninkumar@gmail.com"},"repository":{"url":"git+https://github.com/baninaveen/zrpc.git","type":"git"},"_npmVersion":"10.9.3","description":"A type-safe gRPC framework for Node.js, built with Zod.","directories":{},"_nodeVersion":"22.19.0","dependencies":{"zod":"^4.1.6","@grpc/grpc-js":"^1.13.4","@grpc/proto-loader":"^0.8.0"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.0","typescript":"^5.9.2","@avyaya/zrpc-eslint-config":"workspace:*","@avyaya/zrpc-typescript-config":"workspace:*"},"_npmOperationalInternal":{"tmp":"tmp/zrpc-core_0.2.1_1759590797168_0.2674745524229434","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@avyaya/zrpc-core","version":"0.2.2","private":false,"description":"A type-safe gRPC framework for Node.js, built with Zod.","type":"module","exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.cjs","types":"./dist/index.d.ts"}},"main":"./dist/index.cjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","scripts":{"build":"tsup src/index.ts --format esm,cjs --dts --clean","dev":"pnpm build --watch","lint":"eslint src/"},"keywords":["grpc","rpc","zod","typescript","typesafe"],"author":{"name":"Banisetti Naveen","email":"baninkumar@gmail.com"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/baninaveen/zrpc.git"},"dependencies":{"@grpc/grpc-js":"^1.13.4","@grpc/proto-loader":"^0.8.0","zod":"^4.1.6"},"devDependencies":{"@avyaya/zrpc-eslint-config":"workspace:*","@avyaya/zrpc-typescript-config":"workspace:*","tsup":"^8.5.0","typescript":"^5.9.2"},"_id":"@avyaya/zrpc-core@0.2.2","gitHead":"00529676cafe57474090285d7d1f0065be7c78f4","bugs":{"url":"https://github.com/baninaveen/zrpc/issues"},"homepage":"https://github.com/baninaveen/zrpc#readme","_nodeVersion":"22.19.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-BGSOcBW7cnJ/r+1NvkCv+iid/73aExRsJdJVIuQH19OLoOWLA/G9th+zB21RaW8ZnU9I6VQtR/Qv8W/prHMkwA==","shasum":"6a31064855aceaee497ef6a53b513a7293a0b727","tarball":"https://registry.npmjs.org/@avyaya/zrpc-core/-/zrpc-core-0.2.2.tgz","fileCount":6,"unpackedSize":24778,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD/ikoQCVWT5UD2tbZkP3ddPf5KjsvJYGjW19+ZbUSjgQIhAOzhbyd7ofvTzeAslcqHA8La3WFgmvFZq0I31W70KOFc"}]},"_npmUser":{"name":"baninaveenkr","email":"baninkumar@gmail.com"},"directories":{},"maintainers":[{"name":"baninaveenkr","email":"baninkumar@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/zrpc-core_0.2.2_1759591690372_0.4392589821996189"},"_hasShrinkwrap":false}},"time":{"created":"2025-09-12T17:00:56.833Z","modified":"2025-10-04T15:28:10.788Z","0.2.0":"2025-09-12T17:00:57.134Z","0.2.1":"2025-10-04T15:13:17.369Z","0.2.2":"2025-10-04T15:28:10.578Z"},"bugs":{"url":"https://github.com/baninaveen/zrpc/issues"},"author":{"name":"Banisetti Naveen","email":"baninkumar@gmail.com"},"license":"MIT","homepage":"https://github.com/baninaveen/zrpc#readme","keywords":["grpc","rpc","zod","typescript","typesafe"],"repository":{"type":"git","url":"git+https://github.com/baninaveen/zrpc.git"},"description":"A type-safe gRPC framework for Node.js, built with Zod.","maintainers":[{"name":"baninaveenkr","email":"baninkumar@gmail.com"}],"readme":"<p align=\"center\">\n<svg data-logo=\"logo\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 177 42\" height=\"200\" width=\"250\" style=\"flex justify-center items-center\">\n        <g style=\"opacity: 1;\" id=\"logogram\" transform=\"translate(63, 41) rotate(180) translate(31.5, 20) scale(1, -1) translate(-31.5, -20)\"><path d=\"M63 29.3506L38.117 5.08907C37.4008 4.39081 36.4402 4 35.44 4C31.9983 4 30.2991 8.18294 32.7659 10.583L59.4712 36.5666C60.7577 37.8183 59.8715 40 58.0765 40H9.65685C8.59599 40 7.57857 39.5786 6.82843 38.8284L1.17157 33.1716C0.421426 32.4214 0 31.404 0 30.3431V10.6484L24.883 34.9109C25.5992 35.6092 26.5598 36 27.5601 36C31.0017 36 32.7009 31.8171 30.2342 29.417L3.52882 3.43345C2.24227 2.18166 3.12849 0 4.92354 0L53.3431 0C54.404 0 55.4214 0.421427 56.1716 1.17157L61.8284 6.82843C62.5786 7.57857 63 8.59599 63 9.65685V29.3506Z\" fill=\"#D6770A\"></path></g>\n        <g style=\"opacity: 1;\" id=\"logotype\" transform=\"translate(69, 4)\"><path fill=\"#1f5fe0\" d=\"M27.06 33L6.63 33L6.63 32.33L16.89 16.08Q17.30 15.41 17.97 14.64L17.97 14.64L7.13 14.64L7.13 9.60L27.29 9.60L27.29 10.28L16.93 26.79Q16.57 27.33 16.08 27.96L16.08 27.96L27.06 27.96L27.06 33ZM36.64 33L30.34 33L30.34 1.50L40.52 1.50Q45.83 1.50 48.86 3.95Q51.90 6.41 51.90 11.04L51.90 11.04Q51.90 14.78 49.90 17.07Q47.89 19.37 44.34 20.13L44.34 20.13L53.16 33L45.73 33L39.03 23.01Q38.40 22.07 37.81 20.71L37.81 20.71L36.64 20.71L36.64 33ZM36.64 7.17L36.64 15.05L40.16 15.05Q42.72 15.05 44.11 14.03Q45.51 13.02 45.51 11.09L45.51 11.09Q45.51 9.20 44.11 8.18Q42.72 7.17 40.16 7.17L40.16 7.17L36.64 7.17ZM61.44 33L55.14 33L55.14 1.50L65.76 1.50Q71.07 1.50 74.11 4.00Q77.14 6.50 77.14 11.45L77.14 11.45Q77.14 16.44 74.11 19.01Q71.07 21.57 65.76 21.57L65.76 21.57L61.44 21.57L61.44 33ZM61.44 7.13L61.44 15.90L65.40 15.90Q67.97 15.90 69.36 14.82Q70.75 13.74 70.75 11.49L70.75 11.49Q70.75 9.24 69.36 8.18Q67.97 7.13 65.40 7.13L65.40 7.13L61.44 7.13ZM95.14 33.59L95.14 33.59Q91.63 33.59 88.64 32.33Q85.65 31.07 83.42 28.82Q81.19 26.57 79.96 23.62Q78.72 20.67 78.72 17.30L78.72 17.30Q78.72 13.92 79.91 10.95Q81.11 7.98 83.29 5.73Q85.47 3.48 88.48 2.20Q91.50 0.91 95.14 0.91L95.14 0.91Q99.02 0.91 101.78 2.13Q104.55 3.35 106.66 5.87L106.66 5.87L102.21 9.73Q99.38 6.77 95.14 6.77L95.14 6.77Q92.13 6.77 89.90 8.21Q87.67 9.64 86.46 12.03Q85.25 14.41 85.25 17.30L85.25 17.30Q85.25 20.18 86.46 22.54Q87.67 24.90 89.92 26.32Q92.17 27.73 95.28 27.73L95.28 27.73Q97.58 27.73 99.33 26.97Q101.08 26.20 102.48 24.68L102.48 24.68L107.07 28.59Q105.27 30.75 102.28 32.17Q99.28 33.59 95.14 33.59Z\"></path></g>\n      </svg></p>\n\n[![npm version](https://img.shields.io/npm/v/zrpc.svg?color=blue&style=flat-square)](https://www.npmjs.com/package/zrpc)\n[![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat-square)](LICENSE)\n[![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue?style=flat-square)](https://www.typescriptlang.org/)\n\n\n✨ zRPC: The Missing Type-Safe gRPC Framework for Node.js\nzRPC is a lightweight, developer-friendly framework that brings end-to-end type safety to gRPC in Node.js, without ever needing to write a .proto file. By leveraging the power of Zod for schema definition and validation, zRPC allows you to build robust, high-performance RPC APIs with a development experience similar to tRPC.\n\n## Key Features\n🚀 End-to-End Type Safety: Automatically infer client-side types directly from your server's router definition.\n\n✍️ No .proto Files: Define your API contract once using Zod schemas in plain TypeScript.\n\n✅ Automatic Validation: Built-in server-side and client-side validation powered by Zod.\n\n🤝 Developer-Friendly: A simple, minimal API for creating servers and clients with modern async/await.\n\n⚡ High Performance: Built on top of the native @grpc/grpc-js library, giving you all the performance benefits of gRPC and HTTP/2.\n\n## Installation\nInstall the core library and the command-line tool.\n\n```bash\npnpm add @avyaya/core @grpc/grpc-js zod\npnpm add -D @avyaya/cli\n```\n## Quick Start\nLet's build a simple Greeter service in 3 steps.\n\n### 1. Define Your Router\nCreate a central file to define your schemas and services. The router is the single source of truth for your API.\n\n```bash\nsrc/router.ts:\n```\n\nTypeScript\n\n```typescript\nimport { z } from 'zod';\n\nconst schemas = {\n  SayHelloRequest: z.object({\n    name: z.string(),\n  }),\n  SayHelloReply: z.object({\n    message: z.string(),\n  }),\n};\n\nconst services = {\n  greeter: {\n    async sayHello(input: z.infer<typeof schemas.SayHelloRequest>) {\n      console.log(`Handling request for: ${input.name}`);\n      return {\n        message: `Hello, ${input.name}!`,\n      };\n    },\n  },\n};\n\nexport const appRouter = { schemas, services };\nexport type AppRouter = typeof appRouter;\n```\n\n### 2. Create the Server\nCreate a file to initialize and run your gRPC server.\n\n```bash\nsrc/server.ts:\n```\n\n```typescript\nimport { createZrpcServer } from '@avyaya/core';\nimport { appRouter } from './router';\n\nconst server = createZrpcServer(appRouter, '0.0.0.0:50051');\nserver.start();\n\nconsole.log('🚀 Server running on port 50051');\n```\n### 3. Create the Client\nCreate a client to call your server. Notice how we only import the type of the AppRouter, not the runtime object, keeping the client fully decoupled.\n\n```bash\nsrc/client.ts:\n```\n\n```typescript\nimport { createZrpcClient } from '@avyaya/core';\nimport type { AppRouter } from './router'; // Import ONLY the type\n\nasync function main() {\n  const client = createZrpcClient<AppRouter>({\n    // In a real app, you would generate and import the proto string\n    // For this quick start, we pass the router to generate it at runtime.\n    router: appRouter,\n    address: 'localhost:50051'\n  });\n\n  const response = await client.greeter.sayHello({ name: 'World' });\n\n  console.log('✅ Server Response:', response.message);\n  // Output: ✅ Server Response: Hello, World!\n}\n\nmain();\n```\n\n## Contributing\nContributions are welcome! Please see the CONTRIBUTING.md file for guidelines on how to set up the development environment, run tests, and submit a pull request.\n\n## License\nThis project is licensed under the MIT License. See the LICENSE file for details.\n\nIt's been a long and productive week of building here in Barrackpore. Congratulations on creating a fantastic open-source project!","readmeFilename":"README.md"}