{"id":30956092,"url":"https://github.com/do-pa/itdoc","last_synced_at":"2025-09-11T12:07:10.963Z","repository":{"id":281660783,"uuid":"936970541","full_name":"do-pa/itdoc","owner":"do-pa","description":"The Best Node.js Tool for Automatically Generating API Documentation from Test Code","archived":false,"fork":false,"pushed_at":"2025-08-20T05:21:34.000Z","size":10728,"stargazers_count":108,"open_issues_count":7,"forks_count":3,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-08-20T07:21:17.603Z","etag":null,"topics":["api-documentation","javascript","nodejs","openapi3","test-automation","test-driven","typescript"],"latest_commit_sha":null,"homepage":"https://itdoc.kr/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/do-pa.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-02-22T03:12:55.000Z","updated_at":"2025-08-18T03:13:40.000Z","dependencies_parsed_at":"2025-04-01T16:36:18.409Z","dependency_job_id":"16e4b9d9-d3a6-43be-80e7-4ea4061bea94","html_url":"https://github.com/do-pa/itdoc","commit_stats":null,"previous_names":["do-pa/itdoc"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/do-pa/itdoc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/do-pa%2Fitdoc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/do-pa%2Fitdoc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/do-pa%2Fitdoc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/do-pa%2Fitdoc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/do-pa","download_url":"https://codeload.github.com/do-pa/itdoc/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/do-pa%2Fitdoc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274632633,"owners_count":25321251,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-11T02:00:13.660Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["api-documentation","javascript","nodejs","openapi3","test-automation","test-driven","typescript"],"created_at":"2025-09-11T12:03:56.487Z","updated_at":"2025-09-11T12:07:10.952Z","avatar_url":"https://github.com/do-pa.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# \u003cimg src=\"https://github.com/do-pa/itdoc/blob/develop/itdoc-doc/static/img/logo.png?raw=true\" align=\"right\" width=\"100\"\u003eitdoc\n\n[![Build Status](https://github.com/do-pa/itdoc/actions/workflows/ci.yml/badge.svg)](https://github.com/do-pa/itdoc/actions/workflows/ci.yml)\n[![NPM](https://img.shields.io/npm/v/itdoc.svg)](https://www.npmjs.com/package/itdoc)\n![Node.js](https://img.shields.io/badge/node.js-%3E%3D20.0.0-brightgreen?logo=node.js\u0026logoColor=white\u0026style=flat-square)\n[![License](https://img.shields.io/:license-apache-brightgreen.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)\n[![Discord](https://img.shields.io/badge/Chat-Discord-5765F2.svg)](https://discord.gg/ZhXk7VSu5Z)\n\n**itdoc is a Node.js tool for automatically generating API documentation based on your test\ncode.**  \nHate writing docs? Let your tests do it. Your API docs stay in sync—no surprises, ever.\n\n\u003e A perfect alternative to [swagger-jsdoc] and [swagger-ui-express].\n\n[swagger-jsdoc]: https://github.com/Surnet/swagger-jsdoc\n[swagger-ui-express]: https://github.com/scottie1984/swagger-ui-express\n\n- **Test-based Documentation:** itdoc generates documentation by directly extracting API request and\n  response examples from your test code, ensuring your documentation accurately reflects your API\n  behavior.\n- **Multiple Documentation Formats:** Export documentation in various formats, such as\n  [OpenAPI Specification](https://swagger.io/specification/), Markdown, and HTML\n  ([Redoc-style](https://redocly.github.io/redoc/)).\n- **Supports Various Frameworks:** Compatible with popular Node.js frameworks like Express, NestJS,\n  fastify.\n- **Easy to Use Without Complex Configuration:** Generate documentation effortlessly by writing\n  tests alone. ([Optional configuration is available](https://itdoc.kr/docs/guides/configuration))\n\n[//]: # \"TODO : 나중에 CLI 문서 작성된다면, REAMDE에 추가할 것.\"\n[OpenAPI Specification]: https://swagger.io/specification/\n[Redoc-style]: https://redocly.github.io/redoc/\n[HTML output]: http://redocly.com/demo/openapi/museum-api/operations/getmuseumhours\n\n## Installation\n\n```bash\nnpm install itdoc --save-dev\n```\n\n## Documentation\n\nFull documentation for itdoc can be found on the [official website](https://itdoc.kr/).\n\n\u003e you can contribute to improving our documentation by submitting a PR to our\n\u003e [docs folder](https://github.com/do-pa/itdoc/tree/develop/itdoc-doc).\n\n## Examples\n\nWe have several examples available in the [examples directory]. Here's a simple Express example to\nhelp you get started.\n\n```javascript\nimport { describeAPI, itDoc, field, HttpMethod, HttpStatus } from \"itdoc\"\n\n// Assume you have an Express app\nconst targetApp = app\n\ndescribeAPI(\n    HttpMethod.POST,\n    \"/signup\",\n    {\n        name: \"Sign Up API\",\n        tag: \"Auth\",\n        summary: \"Receives a username and password from the user to perform sign-up.\",\n    },\n    targetApp,\n    (apiDoc) =\u003e {\n        itDoc(\"Successful sign-up\", () =\u003e {\n            return apiDoc\n                .test()\n                .req()\n                .body({\n                    username: field(\"Username\", \"penekhun\"),\n                    password: field(\"Password\", \"P@ssw0rd123!@#\"),\n                })\n                .res()\n                .status(HttpStatus.CREATED)\n        })\n\n        itDoc(\"Fails to sign up if username is not provided.\", async () =\u003e {\n            await apiDoc\n                .test()\n                .req()\n                .body({\n                    password: field(\"Password\", \"P@ssw0rd123!@#\"),\n                })\n                .res()\n                .status(HttpStatus.BAD_REQUEST)\n                .body({\n                    error: field(\"Error message\", \"username is required\"),\n                })\n        })\n    },\n)\n```\n\n[examples directory]: https://github.com/do-pa/itdoc/tree/develop/examples\n\n\u003e - If you are using Express, please refer to the [Quick Start Guide].\n\u003e - If you are using NestJS, please refer to the [Quick Start Guide] and [NestJS guide].\n\u003e - If you are using fastify, please refer to the [Quick Start Guide] and [fastify guide].\n\n[Quick Start Guide]: https://itdoc.kr/docs/guides/quick-start\n[NestJS guide]: https://itdoc.kr/docs/guides/framework-guide/#nestjs-example\n[fastify guide]: https://itdoc.kr/docs/guides/framework-guide/#fastify-example\n\n## Running Tests\n\nSince `describeAPI()` and `itdoc()` integrate seamlessly with testing frameworks like\n[Jest](https://jestjs.io/docs/getting-started) and [Mocha](https://mochajs.org/#getting-started),\nyou can simply use your existing test commands such as `mocha .` or `jest .` without any changes.\n\n## Contributing\n\nWe welcome contributions! Please open an issue or submit a pull request. See\n[CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n## License\n\nThis project is licensed under the terms of the [Apache 2.0 License](LICENSE.txt).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdo-pa%2Fitdoc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdo-pa%2Fitdoc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdo-pa%2Fitdoc/lists"}