{"id":19359958,"url":"https://github.com/darrachequesne/tsdoc-extractor","last_synced_at":"2026-04-21T10:04:34.548Z","repository":{"id":65387988,"uuid":"563725035","full_name":"darrachequesne/tsdoc-extractor","owner":"darrachequesne","description":"Extract documentation from TypeScript files. Based on deno_doc.","archived":false,"fork":false,"pushed_at":"2023-07-20T14:38:20.000Z","size":2069,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-06T12:59:32.476Z","etag":null,"topics":["documentation","jsdoc","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/tsdoc-extractor","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/darrachequesne.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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}},"created_at":"2022-11-09T07:46:13.000Z","updated_at":"2022-12-09T20:27:33.000Z","dependencies_parsed_at":"2024-11-10T07:16:47.491Z","dependency_job_id":"2afd5e3a-9dc1-4068-b304-3637b47728db","html_url":"https://github.com/darrachequesne/tsdoc-extractor","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"08a687df101e2e869eff6caa5a82ea675503b3c8"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/darrachequesne/tsdoc-extractor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darrachequesne%2Ftsdoc-extractor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darrachequesne%2Ftsdoc-extractor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darrachequesne%2Ftsdoc-extractor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darrachequesne%2Ftsdoc-extractor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/darrachequesne","download_url":"https://codeload.github.com/darrachequesne/tsdoc-extractor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/darrachequesne%2Ftsdoc-extractor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285043888,"owners_count":27105357,"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-11-18T02:00:05.759Z","response_time":61,"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":["documentation","jsdoc","typescript"],"created_at":"2024-11-10T07:16:40.099Z","updated_at":"2025-11-18T10:03:16.881Z","avatar_url":"https://github.com/darrachequesne.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tsdoc-extractor\n\nExtract documentation from TypeScript files. Based on [deno_doc](https://github.com/denoland/deno_doc).\n\n## Installation\n\n```\n$ npm install tsdoc-extractor\n```\n\n## Usage\n\n`product.ts`\n\n```ts\n/**\n * This is a product\n */\nexport interface Product {\n  id: string;\n}\n```\n\nLet's extract the documentation:\n\n```js\nimport { doc } from \"tsdoc-extractor\";\n\nconst url = new URL(\"product.ts\", import.meta.url).toString();\nconst nodes = await doc(url);\n\nconsole.log(nodes[0]);\n/*\n{\n  \"kind\": \"interface\",\n  \"name\": \"Product\",\n  \"location\": {\n    \"filename\": \"file:///tmp/product.ts\",\n    \"line\": 4,\n    \"col\": 0\n  },\n  \"declarationKind\": \"export\",\n  \"jsDoc\": {\n    \"doc\": \"This is a product\"\n  },\n  \"interfaceDef\": {\n    \"extends\": [],\n    \"methods\": [],\n    \"properties\": [\n      {\n        \"name\": \"id\",\n        \"location\": {\n          \"filename\": \"file:///tmp/product.ts\",\n          \"line\": 5,\n          \"col\": 2\n        },\n        \"params\": [],\n        \"computed\": false,\n        \"optional\": false,\n        \"tsType\": {\n          \"repr\": \"string\",\n          \"kind\": \"keyword\",\n          \"keyword\": \"string\"\n        },\n        \"typeParams\": []\n      }\n    ],\n    \"callSignatures\": [],\n    \"indexSignatures\": [],\n    \"typeParams\": []\n  }\n}\n*/\n```\n\n## Advanced\n\n### Resolve types from a dependency\n\n`product.ts`\n\n```ts\nimport { Reference } from \"my-dependency\";\n\n/**\n * This is a product\n */\nexport interface Product {\n    id: string;\n    ref: Reference;\n}\n```\n\nTo resolve the types from a dependency, you need to provide a custom `resolve` method:\n\n```js\nimport { doc, defaultResolver } from \"tsdoc-extractor\";\n\nconst url = new URL(\"product.ts\", import.meta.url).toString();\nconst nodes = await doc(url, {\n  resolve: function (specifier, referrer) {\n    if (specifier === \"my-dependency\") {\n      return \"file:///Projects/my-project/node_modules/my-dependency/dist/index.d.ts\";\n      // or \"file:///Projects/my-project/node_modules/my-dependency/index.ts\";\n      // or \"file:///Projects/my-project/node_modules/@types/my-dependency/index.d.ts\";\n    } else {\n      return defaultResolver(specifier, referrer);\n    }\n  }\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarrachequesne%2Ftsdoc-extractor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarrachequesne%2Ftsdoc-extractor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarrachequesne%2Ftsdoc-extractor/lists"}