{"id":50152641,"url":"https://github.com/chetanbasuray/doc-sync-check","last_synced_at":"2026-05-24T09:01:40.051Z","repository":{"id":349387010,"uuid":"1201912432","full_name":"chetanbasuray/doc-sync-check","owner":"chetanbasuray","description":null,"archived":false,"fork":false,"pushed_at":"2026-05-24T08:23:33.000Z","size":696,"stargazers_count":0,"open_issues_count":44,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-24T08:25:57.987Z","etag":null,"topics":["cli","code-quality","developer-tools","documentation","javascript","jsdoc","markdown","tsdoc","typescript"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/chetanbasuray.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["chetanbasuray"]}},"created_at":"2026-04-05T10:34:50.000Z","updated_at":"2026-05-24T07:49:00.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/chetanbasuray/doc-sync-check","commit_stats":null,"previous_names":["chetanbasuray/doc-sync-check"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/chetanbasuray/doc-sync-check","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chetanbasuray%2Fdoc-sync-check","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chetanbasuray%2Fdoc-sync-check/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chetanbasuray%2Fdoc-sync-check/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chetanbasuray%2Fdoc-sync-check/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chetanbasuray","download_url":"https://codeload.github.com/chetanbasuray/doc-sync-check/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chetanbasuray%2Fdoc-sync-check/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33427584,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T22:14:44.296Z","status":"online","status_checked_at":"2026-05-24T02:00:06.296Z","response_time":57,"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":["cli","code-quality","developer-tools","documentation","javascript","jsdoc","markdown","tsdoc","typescript"],"created_at":"2026-05-24T09:01:34.787Z","updated_at":"2026-05-24T09:01:40.041Z","avatar_url":"https://github.com/chetanbasuray.png","language":"TypeScript","funding_links":["https://github.com/sponsors/chetanbasuray"],"categories":[],"sub_categories":[],"readme":"# doc-sync-check\n\n\u003e **Stop documentation drift in its tracks.**\n\n`doc-sync-check` is a fast, specialized CLI tool that statically analyzes your TypeScript and JavaScript (JSDoc) codebase using an Abstract Syntax Tree (AST). It scans your Markdown files for exported symbols and ensures that documented signatures match source code.\n\nIf you update a parameter or return type in your code but forget to update the documentation, `doc-sync-check` will catch it and fail your CI build, reminding your team to keep the docs in sync!\n\n## 🚀 Installation\n\nYou can install `doc-sync-check` globally, but it is recommended to add it as a `devDependency` to your project and run it via an npm script or CI pipeline.\n\n```bash\nnpm install -D doc-sync-check\n```\n\n## 🛠️ Usage\n\nRun `doc-sync-check` by pointing it to your source code directory and specifying your documentation folder.\n\n```bash\nnpx doc-sync-check \u003csource-dir\u003e --docs \u003cdocs-dir\u003e\n```\n\n### Options\n- `\u003csource-dir\u003e`: The root directory containing your TypeScript files.\n- `--docs, -d`: The path to the folder containing your Markdown documentation files. Defaults to `./docs`.\n- `--include, -i`: One or more glob patterns for documentation files. Overrides `--docs`.\n- `--strict, -s`: If set, the CLI will exit with code 1 if any documentation drift is detected. Defaults to `false`.\n- `--cache`: Enables incremental caching so unchanged files are skipped.\n- `--coverage-out`: Writes coverage output to a file.\n- `--coverage-format`: `json` (default), `sonar`, or `cobertura`.\n- `--fix-docs`: Auto-trims inline markdown signature blocks.\n- `--check-descriptions`: Compares JSDoc descriptions against markdown text.\n- `--update-readme`: Updates function list between README markers.\n- `--init`: Creates a starter `.doc-sync-checkrc.json`.\n- `--slack-webhook` and `--discord-webhook`: Sends drift failure notifications.\n\n### Example\n```bash\nnpx doc-sync-check src --docs docs\n```\n\n```bash\nnpx doc-sync-check src --include \"docs/**/*.md\" \"README.md\" --strict\n```\n\n## 🧠 How it Works\n\n1. **Extraction**: The parser walks your source AST and extracts exported symbols:\n   - exported functions\n   - exported interfaces (including property/method types)\n   - exported classes and class methods (excluding private methods)\n   - exported type aliases\n   - exported enums/constants\n   - namespace exports\n2. **Normalization**: Signatures are converted to single-line forms so multiline declarations still match docs reliably.\n3. **Drift Detection**: Any Markdown file mentioning a detected symbol by exact name should include the up-to-date signature. Missing or stale signatures are flagged. With `--strict`, drift returns exit code `1`.\n\n## Integrations\n\n- Docusaurus/VuePress markdown patterns are supported by default.\n- Coverage can be exported in Sonar/Cobertura-friendly formats.\n- Drift failures can notify Slack/Discord webhooks.\n- VSCode extension scaffold is available under `.vscode-extension/`.\n\n## Website\n\nA simple project website scaffold is available in `website/` for GitHub Pages.\n\n## README Sync Section\n\nYou can auto-populate this section with `--update-readme`.\n\n\u003c!-- DOC_SYNC_FUNCTIONS_START --\u003e\n- `extractSignatures(code: string): FunctionSignature[]`\n- `checkDrift(signatures: FunctionSignature[], docs: string | string[]): Promise\u003cDriftResult\u003e`\n\u003c!-- DOC_SYNC_FUNCTIONS_END --\u003e\n\n## 🤝 Contributing\n\nWe welcome community contributions! Please check out our [Contributing Guide](CONTRIBUTING.md) to get started on setting up the repository, running tests, and understanding the architecture.\n\n## 📄 License\n\nThis project is licensed under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchetanbasuray%2Fdoc-sync-check","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchetanbasuray%2Fdoc-sync-check","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchetanbasuray%2Fdoc-sync-check/lists"}