{"_id":"@byc/elysiajs-swagger","name":"@byc/elysiajs-swagger","dist-tags":{"latest":"1.3.1"},"versions":{"1.3.1":{"name":"@byc/elysiajs-swagger","version":"1.3.1","description":"Plugin for Elysia to auto-generate Swagger page","author":{"name":"saltyAom","email":"saltyaom@gmail.com","url":"https://github.com/SaltyAom"},"main":"./dist/cjs/index.js","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{"./package.json":"./package.json",".":{"types":"./dist/index.d.ts","import":"./dist/index.mjs","require":"./dist/cjs/index.js"},"./types":{"types":"./dist/types.d.ts","import":"./dist/types.mjs","require":"./dist/cjs/types.js"},"./utils":{"types":"./dist/utils.d.ts","import":"./dist/utils.mjs","require":"./dist/cjs/utils.js"},"./scalar":{"types":"./dist/scalar/index.d.ts","import":"./dist/scalar/index.mjs","require":"./dist/cjs/scalar/index.js"},"./scalar/theme":{"types":"./dist/scalar/theme.d.ts","import":"./dist/scalar/theme.mjs","require":"./dist/cjs/scalar/theme.js"}},"keywords":["elysia","swagger"],"homepage":"https://github.com/elysiajs/elysia-swagger","repository":{"type":"git","url":"git+https://github.com/elysiajs/elysia-swagger.git"},"bugs":{"url":"https://github.com/elysiajs/elysia-swagger/issues"},"license":"MIT","scripts":{"dev":"bun run --watch example/index.ts","test":"bun test && npm run test:node","test:node":"npm install --prefix ./test/node/cjs/ && npm install --prefix ./test/node/esm/ && node ./test/node/cjs/index.js && node ./test/node/esm/index.js","build":"bun build.ts","release":"npm run build && npm run test && npm publish --access public"},"peerDependencies":{"elysia":">= 1.3.0"},"devDependencies":{"@apidevtools/swagger-parser":"^10.1.0","@types/bun":"1.1.14","elysia":"1.3.0-exp.71","eslint":"9.6.0","tsup":"^8.1.0","typescript":"^5.5.3"},"dependencies":{"@scalar/themes":"^0.9.52","@scalar/types":"^0.0.12","@sinclair/typebox":"^0.34.38","openapi-types":"^12.1.3","pathe":"^1.1.2"},"_id":"@byc/elysiajs-swagger@1.3.1","gitHead":"d56c54282426a79be5bf6a483a6377dab1e19e26","_nodeVersion":"22.14.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-zyXutahgIobk+vj/DN8/QzR+TgsRs9L63s27HnVx2u4nNUjGoTPTV5ql9YmA7OTkVXLgJ8WVnRxOzbHQKa9a2w==","shasum":"ffede77c3e8a3f5a74dd775ad3a9416647e58233","tarball":"https://registry.npmjs.org/@byc/elysiajs-swagger/-/elysiajs-swagger-1.3.1.tgz","fileCount":25,"unpackedSize":143125,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDNSRvX9LcofvJKFFx8cQTcawYKI8ofINRWIhP0A8iMAQIgBo1ajpYcEJ6rQP30c1yAHWZSJAM/KMZkK3Ysi9RVgRA="}]},"_npmUser":{"name":"byc","email":"2786660867@qq.com"},"directories":{},"maintainers":[{"name":"byc","email":"2786660867@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/elysiajs-swagger_1.3.1_1754492391558_0.3510231699222328"},"_hasShrinkwrap":false}},"time":{"created":"2025-08-06T14:59:51.410Z","1.3.1":"2025-08-06T14:59:51.853Z","modified":"2025-08-06T14:59:52.121Z"},"maintainers":[{"name":"byc","email":"2786660867@qq.com"}],"description":"Plugin for Elysia to auto-generate Swagger page","homepage":"https://github.com/elysiajs/elysia-swagger","keywords":["elysia","swagger"],"repository":{"type":"git","url":"git+https://github.com/elysiajs/elysia-swagger.git"},"author":{"name":"saltyAom","email":"saltyaom@gmail.com","url":"https://github.com/SaltyAom"},"bugs":{"url":"https://github.com/elysiajs/elysia-swagger/issues"},"license":"MIT","readme":"# @elysiajs/swagger\nPlugin for [elysia](https://github.com/elysiajs/elysia) to auto-generate Swagger page.\n\n## Installation\n```bash\nbun add @elysiajs/swagger\n```\n\n## Example\n```typescript\nimport { Elysia, t } from 'elysia'\nimport { swagger } from '@elysiajs/swagger'\n\nconst app = new Elysia()\n    .use(swagger())\n    .get('/', () => 'hi', { response: t.String({ description: 'sample description' }) })\n    .post(\n        '/json/:id',\n        ({ body, params: { id }, query: { name } }) => ({\n            ...body,\n            id,\n            name\n        }),\n        {\n            params: t.Object({\n                id: t.String()\n            }),\n            query: t.Object({\n                name: t.String()\n            }),\n            body: t.Object({\n                username: t.String(),\n                password: t.String()\n            }),\n            response: t.Object({\n                username: t.String(),\n                password: t.String(),\n                id: t.String(),\n                name: t.String()\n            }, { description: 'sample description' })\n        }\n    )\n    .listen(8080);\n```\n\nThen go to `http://localhost:8080/swagger`.\n\n# config\n\n## provider\n@default 'scalar'\nChoose between [Scalar](https://github.com/scalar/scalar) & [SwaggerUI](https://github.com/swagger-api/swagger-ui)\n\n## scalar\nCustomize scalarConfig, refers to [Scalar config](https://github.com/scalar/scalar/blob/main/documentation/configuration.md)\n\n## swagger\nCustomize Swagger config, refers to [Swagger 3.0.3 config](https://swagger.io/specification/v3)\n\n## path\n@default '/swagger'\n\nThe endpoint to expose Swagger\n\n## excludeStaticFile\n@default true\n\nDetermine if Swagger should exclude static files.\n\n## exclude\n@default []\n\nPaths to exclude from the Swagger endpoint\n","readmeFilename":"README.md","_rev":"1-ea2a7c8e7212601a46ee2b8811e1850a"}