{"id":13800279,"url":"https://github.com/a-s-o/koa-docs","last_synced_at":"2026-03-05T04:01:50.736Z","repository":{"id":57098362,"uuid":"45921649","full_name":"a-s-o/koa-docs","owner":"a-s-o","description":"An automatic documentation generator for koa.js APIs ","archived":false,"fork":false,"pushed_at":"2018-03-20T17:42:15.000Z","size":49,"stargazers_count":79,"open_issues_count":7,"forks_count":16,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-19T20:56:22.973Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/a-s-o.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-10T15:38:44.000Z","updated_at":"2024-08-12T10:51:02.000Z","dependencies_parsed_at":"2022-08-20T16:51:09.617Z","dependency_job_id":null,"html_url":"https://github.com/a-s-o/koa-docs","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/a-s-o/koa-docs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-s-o%2Fkoa-docs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-s-o%2Fkoa-docs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-s-o%2Fkoa-docs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-s-o%2Fkoa-docs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/a-s-o","download_url":"https://codeload.github.com/a-s-o/koa-docs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a-s-o%2Fkoa-docs/sbom","scorecard":{"id":157847,"data":{"date":"2025-08-11","repo":{"name":"github.com/a-s-o/koa-docs","commit":"dbf283e8cb05f219fea127653de666c4539d523f"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":1,"reason":"Found 3/24 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 9 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-16T12:22:38.901Z","repository_id":57098362,"created_at":"2025-08-16T12:22:38.902Z","updated_at":"2025-08-16T12:22:38.902Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30109075,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-05T03:40:26.266Z","status":"ssl_error","status_checked_at":"2026-03-05T03:39:15.902Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T00:01:11.061Z","updated_at":"2026-03-05T04:01:50.716Z","avatar_url":"https://github.com/a-s-o.png","language":"JavaScript","readme":"# koa-docs\nAn automatic documentation generator for [koa](https://github.com/koajs/koa) APIs. The goal is to make documentation easy using route specs that may already exist.\n\n* [Usage](#usage)\n* API:\n    * [docs.get()](#docsgetpath-options)\n    * That's it (just one method)\n* Specs:\n    * [Groups](#group-specs)\n    * [Routes](#route-specs)\n* Links:\n    * [Github repo](https://github.com/a-s-o/koa-docs)\n    * [Sample output](http://a-s-o.github.io/koa-docs/example.html)\n\n## Demo\n\nSee `example` folder for source code. [View example output](http://a-s-o.github.io/koa-docs/example.html)\n\n![Screenshot](http://i.imgur.com/jv1k4g3.png)\n\n## Install\n\n    \u003e npm install --save koa-docs@2.x.x\n\nNote version `2.x.x` of this package uses joi router version `^3` specs; use version `1.x.x` of this\npackage if you are using older specs\n\n## Usage\n\n```javascript\nconst app = require('koa')();\nconst docs = require('koa-docs');\n\n// Create a path for viewing the docs (only GET method is supported)\napp.use(docs.get('/docs', {\n   title: 'Pet Store API',\n   version: '1.0.0',\n\n   theme: 'simplex',    // Specify a theme from www.bootswatch.com;\n                        // default is un-themed bootstrap\n\n   routeHandlers: 'disabled',  // Hide the route implementation code from docs\n\n   groups: [\n      { groupName: 'Pets', routes: [/*  ... route specs ...  */] },\n      { groupName: 'Store', routes: [/*  ... route specs ...  */] }\n   ]\n}));\n\napp.listen(3000, (err) =\u003e {\n   if (err) throw err;\n   console.log(`Docs are available at http://localhost:3000/docs`);\n});\n```\n\n## docs.get(path, options)\n\nCreates a koa middleware which generates and serves api documentation\nusing the specs provided in the options object.\n\n**Arguments**\n\n1. path (String): the GET path at which the documentation will be served\n2. options (Object)\n    - `title`: string representing the page title; displayed at the top of the docs\n    - `version`: string representing api version; also displayed at top of the docs\n    - `routeHandlers`: string indicating whether to show the route handler code in the docs. Options are __disabled__, __expanded__ or __collapsed__ (collapsed is the default)\n    - `theme`: string name of a theme from [bootswatch](http://www.bootswatch.com) to be used as the default theme\n    - `groups`: array of [group specs](#group-specs) as described below\n\n**Returns**\n\n(GeneratorFunction): Middleware suitable for use in koa.js app\n\n## Group specs\nGroups are used to logically display the various sections of your api. They are declared as follows:\n\n- `groupName`: string representing the name of the group\n- `description`: string that describes the group; keep this short at about 1 scentence. This is displayed in both expanded and collapsed states as well as in tooltips. This should be a simple string; no markdown\n- `extendedDescription`: string that supports markdown and is displayed only in when a group is being displayed in an expanded state. Make this as long as you need.\n- `prefix`: optional string to be prefixed to all route paths in this group\n- `routes`: array of [route specs](#route-specs) representing the routes in this group. See below for details on route specs.\n\n## Route specs\nThe route specs are the same as [koa-joi-router](https://github.com/pebble/koa-joi-router#route-options), therefore, those routes can be used directly with `koa-docs`. Specifications are as follows:\n\n- `method`: **required** HTTP method like \"get\", \"post\", \"put\", etc\n- `path`: **required** string\n- `validate`\n  - `header`: object which conforms to [Joi](https://github.com/hapijs/joi) validation\n  - `query`: object which conforms to [Joi](https://github.com/hapijs/joi) validation\n  - `params`: object which conforms to [Joi](https://github.com/hapijs/joi) validation\n  - `body`: object which conforms to [Joi](https://github.com/hapijs/joi) validation\n  - `maxBody`: max incoming body size for forms or json input\n  - `failure`: HTTP response code to use when input validation fails. default `400`\n  - `type`: if validating the request body, this is **required**. either `form`, `json` or `multipart`\n  - `output`: output validator object which conforms to [Joi](https://github.com/hapijs/joi) validation. if output is invalid, an HTTP 500 is returned\n  - `continueOnError`: if validation fails, this flags determines if `koa-joi-router` should [continue processing](#handling-errors) the middleware stack or stop and respond with an error immediately. useful when you want your route to handle the error response. default `false`\n- `handler`: **required** GeneratorFunction\n- `meta`: meta data about this route. `koa-joi-router` ignores this but stores it along with all other route data\n\n### meta\n\nIn addition to the above options, `koa-docs` looks for the following properties in the `meta` object of each route:\n\n- `friendlyName`: string which is used in the sidebar and route title; route path is used if this is not proivded\n- `description`: string that describes the routes; keep this short at about 1 scentence. This is displayed in both expanded and collapsed states as well as in tooltips. This should be a simple string; no markdown\n- `extendedDescription`: string that supports markdown and is displayed only in when a route is being displayed in an expanded state. Make this as long as you need.\n\n### Sample routes\n\n* [pets example](example/routes/pets.js)\n* [store example](example/routes/store.js)\n\n## Roadmap / Contribution\n\nPlease feel free to claim any of the following features for development; more\nfeatures can be requested by opening an issue.\n\n* [ ] Create separate section for models (joi objects that have a label)\n* [ ] Add popovers for displaying models\n* [ ] Quick filter (fuzzysearch)\n* [ ] Ability to save the generated HTML to file\n* [ ] E2E testing of output\n\n## License\n\n[MIT](LICENSE)\n","funding_links":[],"categories":["仓库"],"sub_categories":["中间件"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa-s-o%2Fkoa-docs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fa-s-o%2Fkoa-docs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa-s-o%2Fkoa-docs/lists"}