{"_id":"@adi-family/http-express","_rev":"4-d2b14ab8eaed915e7c1f1f3bcebeb737","name":"@adi-family/http-express","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@adi-family/http-express","version":"1.0.0","keywords":["http","express","adapter","type-safe","validation","typescript"],"author":{"name":"ADI Family"},"license":"MIT","_id":"@adi-family/http-express@1.0.0","maintainers":[{"name":"mgorunuch","email":"mgorunuch.igor@gmail.com"}],"homepage":"https://github.com/adi-family/http#readme","bugs":{"url":"https://github.com/adi-family/http/issues"},"dist":{"shasum":"e3ce6328e3fc843c255afcc75a57b79592d10558","tarball":"https://registry.npmjs.org/@adi-family/http-express/-/http-express-1.0.0.tgz","fileCount":6,"integrity":"sha512-FbLlSNWMEGiDqwRLGpBnL2OXUwqAdsSc4Sm9hF0q+Q509Fbprr+rKqiKcao/P8yh8HS/xZtY86V55l5dWl1siQ==","signatures":[{"sig":"MEQCIDwNzm04gdSReIkFtuoq2pGPJKjMzYeyoJWL+OHdaKH2AiB9pBn3ziKIHoVXTMgC4jsBHfq+YJr5q5JiASkDaefvTQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":10574},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"f47297207e8b0a091f6b00875f9d54bac0b21915","scripts":{"build":"tsc","typecheck":"tsc --noEmit","prepublishOnly":"bun run build"},"_npmUser":{"name":"mgorunuch","email":"mgorunuch.igor@gmail.com"},"repository":{"url":"git+https://github.com/adi-family/http.git","type":"git","directory":"packages/http-express"},"_npmVersion":"10.9.2","description":"Express adapter for @adi-family/http","directories":{},"_nodeVersion":"23.10.0","dependencies":{"@adi-family/http":"workspace:*"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^3.22.4","express":"^4.18.2","typescript":"^5.3.0","@types/node":"^20.10.0","@types/express":"^4.17.21"},"peerDependencies":{"zod":"^3.22.0","express":"^4.18.0"},"_npmOperationalInternal":{"tmp":"tmp/http-express_1.0.0_1762107130434_0.7728636011015964","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@adi-family/http-express","version":"1.0.1","keywords":["http","express","adapter","type-safe","validation","typescript"],"author":{"name":"ADI Family"},"license":"MIT","_id":"@adi-family/http-express@1.0.1","maintainers":[{"name":"mgorunuch","email":"mgorunuch.igor@gmail.com"}],"homepage":"https://github.com/adi-family/http#readme","bugs":{"url":"https://github.com/adi-family/http/issues"},"dist":{"shasum":"11b540aa752856b583700ddec1b9b8c62f13464b","tarball":"https://registry.npmjs.org/@adi-family/http-express/-/http-express-1.0.1.tgz","fileCount":6,"integrity":"sha512-q2Xsmt6BNJ5itj6+zNlchLGvZ6+py8HT80qGP0csiF0cw+r0z0FPVHBG4pAijScN7P4cViuvKaU+OU8aOy8pGA==","signatures":[{"sig":"MEYCIQC4bCC83ovPqtNpYgc5QEEDyvtiWygzPEaBjGRL3IhsKwIhAMAlyREZ/vZQrGTWhn3gntWmlg7sbAN6i5bIveJK951p","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":10569},"main":"./dist/index.js","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"f47297207e8b0a091f6b00875f9d54bac0b21915","scripts":{"build":"tsc","typecheck":"tsc --noEmit","prepublishOnly":"bun run build"},"_npmUser":{"name":"mgorunuch","email":"mgorunuch.igor@gmail.com"},"repository":{"url":"git+https://github.com/adi-family/http.git","type":"git","directory":"packages/http-express"},"_npmVersion":"10.9.2","description":"Express adapter for @adi-family/http","directories":{},"_nodeVersion":"23.10.0","dependencies":{"@adi-family/http":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^3.22.4","express":"^4.18.2","typescript":"^5.3.0","@types/node":"^20.10.0","@types/express":"^4.17.21"},"peerDependencies":{"zod":"^3.22.0","express":"^4.18.0"},"_npmOperationalInternal":{"tmp":"tmp/http-express_1.0.1_1762108850710_0.46305372266483147","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@adi-family/http-express","version":"1.0.2","keywords":["http","express","adapter","type-safe","validation","typescript"],"author":{"name":"ADI Family"},"license":"MIT","_id":"@adi-family/http-express@1.0.2","maintainers":[{"name":"mgorunuch","email":"mgorunuch.igor@gmail.com"}],"homepage":"https://github.com/adi-family/http#readme","bugs":{"url":"https://github.com/adi-family/http/issues"},"dist":{"shasum":"4504977225e60ac2e0b2f6123db52bca1d07e13b","tarball":"https://registry.npmjs.org/@adi-family/http-express/-/http-express-1.0.2.tgz","fileCount":6,"integrity":"sha512-pSTkykm15tHztsdVEssegvIBImZiqbv4WNiypClUvexlkzMcNtc2fGkXjFaXohN2s5wsMO+rlDVSuyLCjQt6Fg==","signatures":[{"sig":"MEQCIFRf+7wI+2am32JMpVYjGesY/8awD6qs/RqJd/RULz1xAiADu/nWibTcy5l2Ifa8hdJjkg2zegn99KMI1JmE3joHGg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":10589},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.js"}},"gitHead":"b83b53691026e1e7c3782c2a2dcfa4d350f190cf","scripts":{"build":"tsc","typecheck":"tsc --noEmit","prepublishOnly":"bun run build"},"_npmUser":{"name":"mgorunuch","email":"mgorunuch.igor@gmail.com"},"repository":{"url":"git+https://github.com/adi-family/http.git","type":"git","directory":"packages/http-express"},"_npmVersion":"10.9.2","description":"Express adapter for @adi-family/http","directories":{},"_nodeVersion":"23.10.0","dependencies":{"@adi-family/http":"^1.0.0"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^3.22.4","express":"^4.18.2","typescript":"^5.3.0","@types/node":"^20.10.0","@types/express":"^4.17.21"},"peerDependencies":{"zod":"^3.22.0","express":"^4.18.0"},"_npmOperationalInternal":{"tmp":"tmp/http-express_1.0.2_1762649673725_0.381855487243548","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@adi-family/http-express","version":"1.0.3","type":"module","description":"Express adapter for @adi-family/http","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.js","types":"./dist/index.d.ts"}},"scripts":{"build":"tsc","typecheck":"tsc --noEmit","prepublishOnly":"bun run build"},"keywords":["http","express","adapter","type-safe","validation","typescript"],"author":{"name":"ADI Family"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/adi-family/http.git","directory":"packages/http-express"},"bugs":{"url":"https://github.com/adi-family/http/issues"},"homepage":"https://github.com/adi-family/http#readme","dependencies":{"@adi-family/http":"^1.0.0"},"peerDependencies":{"express":"^4.18.0","zod":"^3.22.0"},"devDependencies":{"@types/express":"^4.17.21","@types/node":"^20.10.0","express":"^4.18.2","typescript":"^5.3.0","zod":"^3.22.4"},"_id":"@adi-family/http-express@1.0.3","gitHead":"b83b53691026e1e7c3782c2a2dcfa4d350f190cf","_nodeVersion":"23.10.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-xoh87GmEa9ob/zLZswAWS80k8iPeiBrP3lisEPwFGf6+yIHDFPC1CdNVbYoX5zSs2gqX5+4xOBHaPaycLmD3xw==","shasum":"552adff0f18c12696493328f9b8277e44beeba71","tarball":"https://registry.npmjs.org/@adi-family/http-express/-/http-express-1.0.3.tgz","fileCount":6,"unpackedSize":10589,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCbkg77ahhBcOJ0JCL5UPjwTTVfkS+ObftCbDbCHHFlCAIhALEZl5v3a1gU5u8r1uN4NAD8ZyiKuzk1Wsrh5XnLuEVw"}]},"_npmUser":{"name":"mgorunuch","email":"mgorunuch.igor@gmail.com"},"directories":{},"maintainers":[{"name":"mgorunuch","email":"mgorunuch.igor@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/http-express_1.0.3_1762650302131_0.7859901941148493"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-02T18:12:10.288Z","modified":"2025-11-09T01:05:02.617Z","1.0.0":"2025-11-02T18:12:10.637Z","1.0.1":"2025-11-02T18:40:50.909Z","1.0.2":"2025-11-09T00:54:33.921Z","1.0.3":"2025-11-09T01:05:02.351Z"},"bugs":{"url":"https://github.com/adi-family/http/issues"},"author":{"name":"ADI Family"},"license":"MIT","homepage":"https://github.com/adi-family/http#readme","keywords":["http","express","adapter","type-safe","validation","typescript"],"repository":{"type":"git","url":"git+https://github.com/adi-family/http.git","directory":"packages/http-express"},"description":"Express adapter for @adi-family/http","maintainers":[{"name":"mgorunuch","email":"mgorunuch.igor@gmail.com"}],"readme":"# @adi-family/http-express\n\nExpress adapter for [@adi-family/http](https://www.npmjs.com/package/@adi-family/http) - converts type-safe handlers into Express routes.\n\n## Installation\n\n```bash\nnpm install @adi-family/http @adi-family/http-express express zod\n# or\nbun add @adi-family/http @adi-family/http-express express zod\n```\n\n## Quick Start\n\n```typescript\nimport express from 'express'\nimport { serveExpress } from '@adi-family/http-express'\nimport { getUserHandler, createUserHandler } from './handlers'\n\nconst app = express()\napp.use(express.json())\n\nserveExpress(app, [\n  getUserHandler,\n  createUserHandler\n])\n\napp.listen(3000, () => {\n  console.log('Server running on http://localhost:3000')\n})\n```\n\n## Features\n\n- **Automatic Route Registration** - Maps handlers to Express routes\n- **Built-in Validation** - Validates query and body with Zod\n- **Error Handling** - Handles validation errors automatically\n- **Type Safety** - Full TypeScript support\n\n## Usage Example\n\n### 1. Define Contract\n\n```typescript\nimport { z } from 'zod'\nimport { route } from '@adi-family/http'\nimport type { HandlerConfig } from '@adi-family/http'\n\nexport const createUserConfig = {\n  method: 'POST',\n  route: route.static('/api/users'),\n  body: {\n    schema: z.object({\n      name: z.string(),\n      email: z.string().email()\n    })\n  },\n  response: {\n    schema: z.object({ id: z.string() })\n  }\n} as const satisfies HandlerConfig\n```\n\n### 2. Create Handler\n\n```typescript\nimport { handler } from '@adi-family/http'\nimport { createUserConfig } from './contracts'\n\nexport const createUserHandler = handler(createUserConfig, async (ctx) => {\n  const user = await db.users.create(ctx.body)\n  return { id: user.id }\n})\n```\n\n### 3. Serve with Express\n\n```typescript\nimport express from 'express'\nimport { serveExpress } from '@adi-family/http-express'\nimport { createUserHandler } from './handlers'\n\nconst app = express()\napp.use(express.json())\n\nserveExpress(app, [createUserHandler])\n\napp.listen(3000)\n```\n\n## Documentation\n\nFor complete documentation and examples, visit:\nhttps://github.com/adi-family/http\n\n## License\n\nMIT - See LICENSE file for details\n\nCopyright (c) 2025 ADI Family (https://github.com/adi-family)\n","readmeFilename":"README.md"}