{"id":15792769,"url":"https://github.com/nfour/ts-rank","last_synced_at":"2026-02-09T09:33:53.304Z","repository":{"id":57381073,"uuid":"323814286","full_name":"nfour/ts-rank","owner":"nfour","description":null,"archived":false,"fork":false,"pushed_at":"2021-06-20T23:49:15.000Z","size":1921,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-09T17:55:28.449Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nfour.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-23T05:47:42.000Z","updated_at":"2021-06-24T04:25:34.000Z","dependencies_parsed_at":"2022-09-05T13:50:27.375Z","dependency_job_id":null,"html_url":"https://github.com/nfour/ts-rank","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nfour/ts-rank","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nfour%2Fts-rank","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nfour%2Fts-rank/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nfour%2Fts-rank/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nfour%2Fts-rank/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nfour","download_url":"https://codeload.github.com/nfour/ts-rank/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nfour%2Fts-rank/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270837465,"owners_count":24654387,"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-08-17T02:00:09.016Z","response_time":129,"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":[],"created_at":"2024-10-04T23:04:08.326Z","updated_at":"2026-02-09T09:33:51.658Z","avatar_url":"https://github.com/nfour.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ts-rank\n\nA way to visualize which files \u0026 types are hurting your TypeScript project compilation time.\n\n+ [Usage](#usage)\n+ [How it works / Caveats](#how-it-works--caveats)\n\n## Usage\n\nShould work on most TypeScript projects:\n\n```bash\nnpm run tsc --noEmit  --generateTrace .tsTrace \u0026\u0026 npx ts-rank\n```\n\nWhen using incremental builds, do this to ensure all files are traced:\n\n```bash\nnpm run tsc --noEmit --generateTrace .tsTrace --incremental false --tsBuildInfoFile null \u0026\u0026 npx ts-rank\n```\n\nWill output something like this:\n\n```\n# 2        705.05 ms (18 % of total metrics) (312 metrics)\n\n  201 ms   StyledComponentBase            ../DHI/femo-frontend/node_modules/@types/styled-components/index.d.ts:167:133\n  138 ms   StyledComponentProps           ../DHI/femo-frontend/node_modules/@types/styled-components/index.d.ts:59:9\n  115 ms   StyledComponentProps           ../DHI/femo-frontend/node_modules/@types/styled-components/index.d.ts:59:9\n  26 ms    StyledComponentBase            ../DHI/femo-frontend/node_modules/@types/styled-components/index.d.ts:167:133\n  8 ms     StyledComponent                ../DHI/femo-frontend/node_modules/@types/styled-components/index.d.ts:158:38\n  8 ms     StyledComponentBase            ../DHI/femo-frontend/node_modules/@types/styled-components/index.d.ts:167:133\n  8 ms     StyledComponentProps           ../DHI/femo-frontend/node_modules/@types/styled-components/index.d.ts:59:9\n  7 ms     ReactDefaultizedProps          ../DHI/femo-frontend/node_modules/@types/styled-components/index.d.ts:55:13\n  7 ms     Defaultize                     ../DHI/femo-frontend/node_modules/@types/styled-components/index.d.ts:44:65\n  7 ms     StyledComponentBase            ../DHI/femo-frontend/node_modules/@types/styled-components/index.d.ts:167:133\n\n# 1        757.79 ms (20 % of total metrics) (5438 metrics)\n\n  22 ms    IModelType                     ../DHI/femo-frontend/node_modules/mobx-state-tree/dist/types/complex-types/model.d.ts:79:2\n  21 ms    named                          ../DHI/femo-frontend/node_modules/mobx-state-tree/dist/types/complex-types/model.d.ts:81:32\n  20 ms    named                          ../DHI/femo-frontend/node_modules/mobx-state-tree/dist/types/complex-types/model.d.ts:81:32\n  14 ms    IModelType                     ../DHI/femo-frontend/node_modules/mobx-state-tree/dist/types/complex-types/model.d.ts:79:2\n  13 ms    named                          ../DHI/femo-frontend/node_modules/mobx-state-tree/dist/types/complex-types/model.d.ts:81:32\n  13 ms    IModelType                     ../DHI/femo-frontend/node_modules/mobx-state-tree/dist/types/complex-types/model.d.ts:79:2\n  12 ms    named                          ../DHI/femo-frontend/node_modules/mobx-state-tree/dist/types/complex-types/model.d.ts:81:32\n  11 ms    IModelType                     ../DHI/femo-frontend/node_modules/mobx-state-tree/dist/types/complex-types/model.d.ts:79:2\n  10 ms    ModelInstanceType              ../DHI/femo-frontend/node_modules/mobx-state-tree/dist/types/complex-types/model.d.ts:70:20\n  9 ms     IModelType                     ../DHI/femo-frontend/node_modules/mobx-state-tree/dist/types/complex-types/model.d.ts:79:2\n\n```\n\nFurther usage:\n\n```bash\n# Get help info\nnpx ts-rank --help\n\n# Provide location to the trace files generated by generateTrace\nnpx ts-rank --TRACE_FILE trace/trace.json --TYPES_FILE trace/types.json\n\n# Use --pattern as a glob to filter rankings based on file path\nnpx ts-rank --PATTERN \"**/someFolder/**\"  \n```\n\nPackage json scripts:\n\n```json\n{\n  \"scripts\": {\n    \"trace\": \"tsc --noEmit --generateTrace .tsTrace \u0026\u0026 npx ts-rank\",\n    \"trace:full\": \"tsc --noEmit --incremental false --tsBuildInfoFile null --generateTrace .tsTrace \u0026\u0026 npx ts-rank\",\n  }\n}\n```\n\n## How it works / Caveats\n\nBasically sums up durations based on the `sturcturedTypeRelatedTo` metrics - which is a significant but still only part of the story.\n\nThis metric correlates to type compilation time but more importantly for this tool, it contains information on where the type comes from in an easy-to-parse way.\n\nHopefully this trace info becomes easier to parse in future. Perhaps someone with more experience can contribute further detail.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnfour%2Fts-rank","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnfour%2Fts-rank","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnfour%2Fts-rank/lists"}