{"bugs":{"url":"https://github.com/trpc/trpc/issues"},"dist":{"shasum":"f949bd2c14438da1ad8c963f957aab0ebe923741","tarball":"https://registry.npmjs.org/@trpc/core/-/core-11.0.0-alpha-tmp.163.tgz","fileCount":191,"integrity":"sha512-4q8kPRU/ThDMEbpJHf6rK94yKQrtKjQwtFZ/duQaGySyn9YkmAvV/U06gntmTPiRLaRAcbxXg+C88NjwC72VAA==","signatures":[{"sig":"MEQCIFu5Zxhf9jf3fZ4zh0z1ejIp0FFeFyMRQ+S/XK0coRLFAiAEXoggUmaoZWwNMvMopDwKSST3ajF7QBQq1Wo4GO7B3g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":337748},"main":"dist/index.js","name":"@trpc/core","author":{"name":"KATT"},"module":"dist/index.mjs","readme":"<p align=\"center\">\n  <a href=\"https://trpc.io/\"><img src=\"https://assets.trpc.io/icons/svgs/blue-bg-rounded.svg\" alt=\"tRPC\" height=\"75\"/></a>\n</p>\n\n<h3 align=\"center\">tRPC</h3>\n\n<p align=\"center\">\n  <strong>End-to-end typesafe APIs made easy</strong>\n</p>\n\n<p align=\"center\">\n  <img src=\"https://assets.trpc.io/www/v10/v10-dark-landscape.gif\" alt=\"Demo\" />\n</p>\n\n# `@trpc/server`\n\n> Create tRPC routers and connect them to a server.\n\n## Documentation\n\nFull documentation for `@trpc/server` can be found [here](https://trpc.io/docs/router)\n\n## Installation\n\n```bash\n# npm\nnpm install @trpc/server\n\n# Yarn\nyarn add @trpc/server\n\n# pnpm\npnpm add @trpc/server\n\n# Bun\nbun add @trpc/server\n```\n\nWe also recommend installing `zod` to validate procedure inputs.\n\n## Basic Example\n\n```ts\nimport { initTRPC } from '@trpc/server';\nimport {\n  CreateHTTPContextOptions,\n  createHTTPServer,\n} from '@trpc/server/adapters/standalone';\nimport { z } from 'zod';\n\n// Initialize a context for the server\nfunction createContext(opts: CreateHTTPContextOptions) {\n  return {};\n}\n\n// Get the context type\ntype Context = Awaited<ReturnType<typeof createContext>>;\n\n// Initialize tRPC\nconst t = initTRPC.context<Context>().create();\n\n// Create main router\nconst appRouter = t.router({\n  // Greeting procedure\n  greeting: t.procedure\n    .input(\n      z.object({\n        name: z.string(),\n      }),\n    )\n    .query(({ input }) => `Hello, ${input.name}!`),\n});\n\n// Export the app router type to be imported on the client side\nexport type AppRouter = typeof appRouter;\n\n// Create HTTP server\nconst { listen } = createHTTPServer({\n  router: appRouter,\n  createContext,\n});\n\n// Listen on port 2022\nlisten(2022);\n```\n","exports":{".":{"import":"./dist/index.mjs","default":"./dist/index.js","require":"./dist/index.js"},"./rpc":{"import":"./dist/rpc/index.mjs","default":"./dist/rpc/index.js","require":"./dist/rpc/index.js"},"./http":{"import":"./dist/http/index.mjs","default":"./dist/http/index.js","require":"./dist/http/index.js"},"./shared":{"import":"./dist/shared/index.mjs","default":"./dist/shared/index.js","require":"./dist/shared/index.js"},"./internals":{"import":"./dist/internals/index.mjs","default":"./dist/internals/index.js","require":"./dist/internals/index.js"},"./observable":{"import":"./dist/observable/index.mjs","default":"./dist/observable/index.js","require":"./dist/observable/index.js"},"./package.json":"./package.json"},"funding":["https://trpc.io/sponsor"],"gitHead":"f6495f6a14491373b56df2fc8383c8fbebfd4225","license":"MIT","scripts":{"dev":"pnpm build --watch","lint":"eslint --cache --ext \".js,.ts,.tsx\" --ignore-path ../../.gitignore --report-unused-disable-directives src","build":"rollup --config rollup.config.ts --configPlugin rollup-plugin-swc3","ts-watch":"tsc --watch","benchmark":"tsc --project tsconfig.benchmark.json","codegen-entrypoints":"tsx entrypoints.script.ts"},"typings":"dist/index.d.ts","_npmUser":{"name":"katt","email":"alexander@n1s.se"},"homepage":"https://trpc.io","deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","repository":{"url":"git+https://github.com/trpc/trpc.git","type":"git","directory":"packages/core"},"_npmVersion":"lerna/8.0.0/node@v20.10.0+x64 (linux)","description":"The tRPC core library","directories":{},"maintainers":[{"name":"juliusmarminge","email":"julius0216@outlook.com"},{"name":"sachinraja","email":"sachinraja2349@gmail.com"},{"name":"katt","email":"alexander@n1s.se"}],"_nodeVersion":"20.10.0","eslintConfig":{"overrides":[{"files":["src"],"rules":{"no-restricted-imports":["error","@trpc/core"],"explicit-module-boundary-types":"off"}}]},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsx":"^4.0.0","tslib":"^2.5.0","eslint":"^8.40.0","rollup":"^2.79.1","typescript":"^5.3.3","@types/node":"^20.10.0"},"_npmOperationalInternal":{"tmp":"tmp/core_11.0.0-alpha-tmp.163_1704467442888_0.5383741896194889","host":"s3://npm-registry-packages"},"_id":"@trpc/core@11.0.0-alpha-tmp.163","version":"11.0.0-alpha-tmp.163"}