{"_id":"@alt-stack/server-bun","_rev":"7-5cda386c7cb37988dde21f7dcc677ab7","name":"@alt-stack/server-bun","dist-tags":{"latest":"1.6.2"},"versions":{"0.4.5":{"name":"@alt-stack/server-bun","version":"0.4.5","keywords":[],"author":"","license":"MIT","_id":"@alt-stack/server-bun@0.4.5","maintainers":[{"name":"aaltieri","email":"anthony@timebyping.com"}],"dist":{"shasum":"8ab391fb36b3813bdd7dea609ceecdf508186029","tarball":"https://registry.npmjs.org/@alt-stack/server-bun/-/server-bun-0.4.5.tgz","fileCount":10,"integrity":"sha512-8pciBdhaY2KO5nv48Z/Swr6oMbmVyfv7VuOo6FSlX/yYYXXoHk3eE0E6LgRa28jXOwCG08/L6U4ZciEVhfoJdg==","signatures":[{"sig":"MEQCIAVWslt2GRfc69cxui8uBCsM3S2VfLZS4gCa1VgeuVYiAiBn9Z1gYfIZNh8ZVekJP4zg/UK3eIBSphoaoD+GCFY/Xw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":46343},"main":"./src/index.ts","type":"module","_from":"file:alt-stack-server-bun-0.4.5.tgz","types":"./src/index.ts","exports":{".":{"bun":"./src/index.ts","default":"./src/index.ts"}},"scripts":{"test":"bun test","check-types":"tsc --noEmit"},"_npmUser":{"name":"aaltieri","email":"anthony@timebyping.com"},"_resolved":"/tmp/cda1ac392d6598b5c46350dc7211b572/alt-stack-server-bun-0.4.5.tgz","_integrity":"sha512-8pciBdhaY2KO5nv48Z/Swr6oMbmVyfv7VuOo6FSlX/yYYXXoHk3eE0E6LgRa28jXOwCG08/L6U4ZciEVhfoJdg==","_npmVersion":"10.8.2","description":"Type-safe server framework built on Bun with Zod validation","directories":{},"_nodeVersion":"20.19.6","dependencies":{"@alt-stack/server-core":"0.4.4"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.0.0","oxlint":"^1.24.0","bun-types":"^1.2.5","typescript":"^5.9.2"},"peerDependencies":{"zod":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/server-bun_0.4.5_1766826536733_0.7583936213353832","host":"s3://npm-registry-packages-npm-production"}},"1.4.0":{"name":"@alt-stack/server-bun","version":"1.4.0","keywords":[],"author":"","license":"MIT","_id":"@alt-stack/server-bun@1.4.0","maintainers":[{"name":"aaltieri","email":"anthony@timebyping.com"}],"dist":{"shasum":"f5702dbaedf1d746bdf51040643725c1cac0d970","tarball":"https://registry.npmjs.org/@alt-stack/server-bun/-/server-bun-1.4.0.tgz","fileCount":11,"integrity":"sha512-bNaTxDtkVKcTBYQdPi5pad/rdelyXoELPduELBRKf2xrRiY7z1VrVGhrT135Kc2C/vx+EW/+nJhzG6v+C38J9w==","signatures":[{"sig":"MEYCIQCQZEKQp1JsOQQYJBnqLAgsxQtdJPTuL1q/v8LHYQKMGwIhAJC68cdo0qC8UoHp0mrFAtO23ToLDHy8qllq6nsxpmF6","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":46549},"main":"./src/index.ts","type":"module","_from":"file:alt-stack-server-bun-1.4.0.tgz","types":"./src/index.ts","exports":{".":{"bun":"./src/index.ts","default":"./src/index.ts"}},"scripts":{"test":"bun test","check-types":"tsc --noEmit"},"_npmUser":{"name":"aaltieri","email":"anthony@timebyping.com"},"_resolved":"/tmp/c5344f080735004b963b849b69b8cd04/alt-stack-server-bun-1.4.0.tgz","_integrity":"sha512-bNaTxDtkVKcTBYQdPi5pad/rdelyXoELPduELBRKf2xrRiY7z1VrVGhrT135Kc2C/vx+EW/+nJhzG6v+C38J9w==","_npmVersion":"10.8.2","description":"Type-safe server framework built on Bun with Zod validation","directories":{},"_nodeVersion":"20.20.2","dependencies":{"@alt-stack/server-core":"1.4.0"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.0.0","oxlint":"^1.24.0","bun-types":"^1.2.5","typescript":"^5.9.2"},"peerDependencies":{"zod":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/server-bun_1.4.0_1783621690934_0.7344656282678708","host":"s3://npm-registry-packages-npm-production"}},"1.5.0":{"name":"@alt-stack/server-bun","version":"1.5.0","keywords":[],"author":"","license":"MIT","_id":"@alt-stack/server-bun@1.5.0","maintainers":[{"name":"aaltieri","email":"anthony@timebyping.com"}],"dist":{"shasum":"090d3e4431401ddf08eb7e5b8a47912c84c38ad1","tarball":"https://registry.npmjs.org/@alt-stack/server-bun/-/server-bun-1.5.0.tgz","fileCount":12,"integrity":"sha512-fSB9mJFx/kDUlHwLfi8LlHeb3//BVUVfm1kfP7S+MD3dgozwqGKgQbZZJ1eYnd0mo2SNlfY/olvvIkpnnYsKDA==","signatures":[{"sig":"MEYCIQDKW08ARGJCotzzqw5EU2J/+wKMITYubYTFCpnsZM7wrQIhAOwOR96gAk5tzlfFFQnXeJNCNfs9hw4FJ7W71d6rKwXa","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":50761},"main":"./src/index.ts","type":"module","_from":"file:alt-stack-server-bun-1.5.0.tgz","types":"./src/index.ts","exports":{".":{"bun":"./src/index.ts","default":"./src/index.ts"}},"scripts":{"test":"bun test","check-types":"tsc --noEmit"},"_npmUser":{"name":"aaltieri","email":"anthony@timebyping.com"},"_resolved":"/tmp/a374dfaea4c23dfc8fc025977ebf4a75/alt-stack-server-bun-1.5.0.tgz","_integrity":"sha512-fSB9mJFx/kDUlHwLfi8LlHeb3//BVUVfm1kfP7S+MD3dgozwqGKgQbZZJ1eYnd0mo2SNlfY/olvvIkpnnYsKDA==","_npmVersion":"10.8.2","description":"Type-safe server framework built on Bun with Zod validation","directories":{},"_nodeVersion":"20.20.2","dependencies":{"@alt-stack/server-core":"1.5.0"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.0.0","oxlint":"^1.24.0","bun-types":"^1.2.5","typescript":"^5.9.2"},"peerDependencies":{"zod":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/server-bun_1.5.0_1783713611559_0.949307867352025","host":"s3://npm-registry-packages-npm-production"}},"1.5.1":{"name":"@alt-stack/server-bun","version":"1.5.1","keywords":[],"author":"","license":"MIT","_id":"@alt-stack/server-bun@1.5.1","maintainers":[{"name":"aaltieri","email":"anthony@timebyping.com"}],"dist":{"shasum":"f8697ef93b02daadc20a7a32c5806fb33215786c","tarball":"https://registry.npmjs.org/@alt-stack/server-bun/-/server-bun-1.5.1.tgz","fileCount":12,"integrity":"sha512-WzD0XHhTzFqJgKBo9Fw5iWu+uF9qw05s7mA/fOkV1YdFUqe4XWJuKKmsi2CHoAYkCbWkKKfdxhcxdD4A0QhY5w==","signatures":[{"sig":"MEYCIQD5bCCU44f9yQTJPPQN6KMXPLwvaNjiZPL5Y2ufOLXSLAIhALFPIdES/c4xaczkNxUEsppULySlvPsePMFge94YjGhY","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":50822},"main":"./src/index.ts","type":"module","_from":"file:alt-stack-server-bun-1.5.1.tgz","types":"./src/index.ts","exports":{".":{"bun":"./src/index.ts","default":"./src/index.ts"}},"scripts":{"test":"bun test","check-types":"tsc --noEmit"},"_npmUser":{"name":"aaltieri","email":"anthony@timebyping.com"},"_resolved":"/tmp/cf3fc21ee25abf9e7fa8e827e60c02b0/alt-stack-server-bun-1.5.1.tgz","_integrity":"sha512-WzD0XHhTzFqJgKBo9Fw5iWu+uF9qw05s7mA/fOkV1YdFUqe4XWJuKKmsi2CHoAYkCbWkKKfdxhcxdD4A0QhY5w==","_npmVersion":"10.8.2","description":"Type-safe server framework built on Bun with Zod validation","directories":{},"_nodeVersion":"20.20.2","dependencies":{"@alt-stack/server-core":"1.5.1"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.0.0","oxlint":"^1.24.0","bun-types":"^1.2.5","typescript":"^5.9.2"},"peerDependencies":{"zod":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/server-bun_1.5.1_1784059631485_0.17962416911880563","host":"s3://npm-registry-packages-npm-production"}},"1.6.0":{"name":"@alt-stack/server-bun","version":"1.6.0","keywords":[],"author":"","license":"MIT","_id":"@alt-stack/server-bun@1.6.0","maintainers":[{"name":"aaltieri","email":"anthony@timebyping.com"}],"dist":{"shasum":"c5c6d030b481e2717e54b55a9f3fb1021640935f","tarball":"https://registry.npmjs.org/@alt-stack/server-bun/-/server-bun-1.6.0.tgz","fileCount":12,"integrity":"sha512-GCFLEzDYgn9VElcwGW9vQIVPBkFuZkBte3KRWzkvFG8O57rgq6aScZwDxA3Sl+/t4vXVNilnsFUGZAE4UO/Mbg==","signatures":[{"sig":"MEQCIAwf5jb8Q//EEr4YpU8wnwwhISpWgbmURVTGG+SvxWUzAiBSiTob1tEJ64CLCBH38WoPR4kLts/OEoFpA4hdcehFWg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":50883},"main":"./src/index.ts","type":"module","_from":"file:alt-stack-server-bun-1.6.0.tgz","types":"./src/index.ts","exports":{".":{"bun":"./src/index.ts","default":"./src/index.ts"}},"scripts":{"test":"bun test","check-types":"tsc --noEmit"},"_npmUser":{"name":"aaltieri","email":"anthony@timebyping.com"},"_resolved":"/tmp/5727a6b69d1fe21edee70e429ec734a5/alt-stack-server-bun-1.6.0.tgz","_integrity":"sha512-GCFLEzDYgn9VElcwGW9vQIVPBkFuZkBte3KRWzkvFG8O57rgq6aScZwDxA3Sl+/t4vXVNilnsFUGZAE4UO/Mbg==","_npmVersion":"10.8.2","description":"Type-safe server framework built on Bun with Zod validation","directories":{},"_nodeVersion":"20.20.2","dependencies":{"@alt-stack/server-core":"1.6.0"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.0.0","oxlint":"^1.24.0","bun-types":"^1.2.5","typescript":"^5.9.2"},"peerDependencies":{"zod":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/server-bun_1.6.0_1784714956683_0.05427023447191037","host":"s3://npm-registry-packages-npm-production"}},"1.6.1":{"name":"@alt-stack/server-bun","version":"1.6.1","keywords":[],"author":"","license":"MIT","_id":"@alt-stack/server-bun@1.6.1","maintainers":[{"name":"aaltieri","email":"anthony@timebyping.com"}],"dist":{"shasum":"f65ac129012cbfc5db7cdb1415d94b88986d471f","tarball":"https://registry.npmjs.org/@alt-stack/server-bun/-/server-bun-1.6.1.tgz","fileCount":12,"integrity":"sha512-KtXtPqloOVR/IhXdIDB0HxIoyeDn0R7SyUqhp9v0Mi85vfU6DV4xLL0qrprdRwttLkwcTcQ8ElxUONnspfoXwg==","signatures":[{"sig":"MEQCIECErPM0K6LNoPGqdFHBXgPrQZBZ52Yk1v1gz/JBGAPxAiAjeQfeftWsJ7mV3fBQiiYH6IBkYtemQsBSpWwGdBGqiQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":50944},"main":"./src/index.ts","type":"module","_from":"file:alt-stack-server-bun-1.6.1.tgz","types":"./src/index.ts","exports":{".":{"bun":"./src/index.ts","default":"./src/index.ts"}},"scripts":{"test":"bun test","check-types":"tsc --noEmit"},"_npmUser":{"name":"aaltieri","email":"anthony@timebyping.com"},"_resolved":"/tmp/e28e11241e2d167ac7ae3c8509994723/alt-stack-server-bun-1.6.1.tgz","_integrity":"sha512-KtXtPqloOVR/IhXdIDB0HxIoyeDn0R7SyUqhp9v0Mi85vfU6DV4xLL0qrprdRwttLkwcTcQ8ElxUONnspfoXwg==","_npmVersion":"10.8.2","description":"Type-safe server framework built on Bun with Zod validation","directories":{},"_nodeVersion":"20.20.2","dependencies":{"@alt-stack/server-core":"1.6.1"},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.0.0","oxlint":"^1.24.0","bun-types":"^1.2.5","typescript":"^5.9.2"},"peerDependencies":{"zod":"^4.0.0"},"_npmOperationalInternal":{"tmp":"tmp/server-bun_1.6.1_1785249168301_0.7450060523372668","host":"s3://npm-registry-packages-npm-production"}},"1.6.2":{"name":"@alt-stack/server-bun","version":"1.6.2","description":"Type-safe server framework built on Bun with Zod validation","type":"module","main":"./src/index.ts","types":"./src/index.ts","exports":{".":{"bun":"./src/index.ts","default":"./src/index.ts"}},"keywords":[],"author":"","license":"MIT","dependencies":{"@alt-stack/server-core":"1.6.2"},"peerDependencies":{"zod":"^4.0.0"},"devDependencies":{"bun-types":"^1.2.5","oxlint":"^1.24.0","typescript":"^5.9.2","zod":"^4.0.0"},"scripts":{"test":"bun test","check-types":"tsc --noEmit"},"_id":"@alt-stack/server-bun@1.6.2","_integrity":"sha512-pPh1aA09itimcRIPmrLkrDEO8nY2fKcI+fZ/zTqZxJqVQCO6TJMyU3qMKS6f1wAryu3UC/6lNbUgZpkSrBdZQw==","_resolved":"/tmp/e4e893759d3e0756a0b9c707eb1a8767/alt-stack-server-bun-1.6.2.tgz","_from":"file:alt-stack-server-bun-1.6.2.tgz","_nodeVersion":"20.20.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-pPh1aA09itimcRIPmrLkrDEO8nY2fKcI+fZ/zTqZxJqVQCO6TJMyU3qMKS6f1wAryu3UC/6lNbUgZpkSrBdZQw==","shasum":"d05b12ea964979b7e4ad2c63154be5a7148c17e8","tarball":"https://registry.npmjs.org/@alt-stack/server-bun/-/server-bun-1.6.2.tgz","fileCount":12,"unpackedSize":51040,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDLnXhDn9lAULPBsgA5UuBhrk4mbmlDRJny9pQPA4ZeLAIgYZj/tzMNLcCk9ijx06cdnSQTmB+2WDxmQEE++GVDCQg="}]},"_npmUser":{"name":"aaltieri","email":"anthony@timebyping.com"},"directories":{},"maintainers":[{"name":"aaltieri","email":"anthony@timebyping.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/server-bun_1.6.2_1787164488694_0.4205487833356274"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-27T09:08:56.649Z","modified":"2026-08-19T18:34:49.277Z","0.4.5":"2025-12-27T09:08:56.888Z","1.4.0":"2026-07-09T18:28:11.074Z","1.5.0":"2026-07-10T20:00:11.741Z","1.5.1":"2026-07-14T20:07:11.639Z","1.6.0":"2026-07-22T10:09:16.863Z","1.6.1":"2026-07-28T14:32:48.461Z","1.6.2":"2026-08-19T18:34:48.863Z"},"license":"MIT","keywords":[],"description":"Type-safe server framework built on Bun with Zod validation","maintainers":[{"name":"aaltieri","email":"anthony@timebyping.com"}],"readme":"# `@alt-stack/server-bun`\n\nBun-native adapter for Altstack's typed routers, Zod validation, Result errors, OpenAPI, and request telemetry.\n\n## Quickstart\n\n```bash\nbun add @alt-stack/server-bun zod\n```\n\n```typescript\nimport {\n  createServer,\n  init,\n  ok,\n  type BunBaseContext,\n} from \"@alt-stack/server-bun\";\nimport { z } from \"zod\";\n\nconst t = init<BunBaseContext>();\n\nconst api = t.router({\n  \"/hello/{name}\": t.procedure\n    .input({ params: z.object({ name: z.string() }) })\n    .output(z.object({ message: z.string() }))\n    .get(({ input }) => ok({ message: `Hello, ${input.params.name}` })),\n});\n\nconst server = createServer(\n  { \"/api\": api },\n  { port: 3000 },\n);\n\nconsole.log(server.url.href);\n```\n\n`createServer()` calls `Bun.serve()` immediately. Call `server.stop()` during shutdown and test cleanup. See the full [server quickstart](../../apps/docs/docs/server/quickstart.md).\n\n## Common Patterns\n\n- Extend `BunBaseContext`, pass it to `init()`, and return application fields from `createContext(req, server)`; the adapter supplies `ctx.bun` and `ctx.span`.\n- Include the Altstack router returned by `createDocsRouter()` in the same server config.\n- Return `ok(new Response(...))` for custom status, headers, or non-JSON bodies.\n- Set `port: 0` for an ephemeral test server; default port is 3000 and hostname is `0.0.0.0`.\n- Install/configure `@opentelemetry/api` before enabling telemetry.\n\nCurrent caveats: only Bun is supported; the package exports TypeScript source and uses the global `Bun`. Repeated query keys keep the last value. Invalid JSON becomes `{}`. Output schemas are parsed synchronously. Declared runtime errors are enveloped, but generated OpenAPI error schemas are flat.\n\nSee [Server common patterns](../../apps/docs/docs/server/common-patterns.md).\n\n## API Documentation\n\n[Bun API Documentation](../../apps/docs/docs/server/api/bun.md) covers `createServer`, every option/default, `BunServer`, `BunBaseContext`, `createDocsRouter`, typed router helpers, exact core re-exports, 404/error behavior, and runtime constraints.\n\n## Peer dependencies\n\n- `zod` `^4.0.0`\n- Bun runtime and Bun's built-in types\n\n## License\n\nMIT\n","readmeFilename":"README.md"}