{"id":39099374,"url":"https://github.com/demike/tsuml2","last_synced_at":"2026-01-17T19:01:43.180Z","repository":{"id":42018375,"uuid":"260132032","full_name":"demike/TsUML2","owner":"demike","description":"Generates UML diagrams from TypeScript source code","archived":false,"fork":false,"pushed_at":"2024-12-17T16:01:56.000Z","size":4450,"stargazers_count":310,"open_issues_count":17,"forks_count":40,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-09T17:55:43.793Z","etag":null,"topics":["class","diagram","generator","typescript","uml"],"latest_commit_sha":null,"homepage":"","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/demike.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-04-30T06:32:47.000Z","updated_at":"2025-08-07T23:27:47.000Z","dependencies_parsed_at":"2023-11-24T16:30:40.958Z","dependency_job_id":"e74f539c-7064-452c-af31-7dc2cb8ca743","html_url":"https://github.com/demike/TsUML2","commit_stats":{"total_commits":108,"total_committers":8,"mean_commits":13.5,"dds":0.5462962962962963,"last_synced_commit":"5e583a06f983a6b8ced730b825d780bdf528aeeb"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/demike/TsUML2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/demike%2FTsUML2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/demike%2FTsUML2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/demike%2FTsUML2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/demike%2FTsUML2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/demike","download_url":"https://codeload.github.com/demike/TsUML2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/demike%2FTsUML2/sbom","scorecard":{"id":333595,"data":{"date":"2025-08-11","repo":{"name":"github.com/demike/TsUML2","commit":"7795a2665ec298abc2adf95eca4ef1567a65e08c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.7,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"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":"Code-Review","score":0,"reason":"Found 1/17 approved changesets -- score normalized to 0","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":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/release.yml:1","Info: no jobLevel write permissions found"],"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":"Pinned-Dependencies","score":3,"reason":"dependency not pinned by hash detected -- score normalized to 3","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:28: update your workflow using https://app.stepsecurity.io/secureworkflow/demike/TsUML2/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/demike/TsUML2/release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/demike/TsUML2/release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:51: update your workflow using https://app.stepsecurity.io/secureworkflow/demike/TsUML2/release.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned","Info:   1 out of   1 npmCommand dependencies pinned"],"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":"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":"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":"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":"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":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/release.yml:18"],"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":"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":"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":"Vulnerabilities","score":7,"reason":"3 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 24 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-18T04:09:38.398Z","repository_id":42018375,"created_at":"2025-08-18T04:09:38.398Z","updated_at":"2025-08-18T04:09:38.398Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28516540,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T18:55:29.170Z","status":"ssl_error","status_checked_at":"2026-01-17T18:55:03.375Z","response_time":85,"last_error":"SSL_read: 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":["class","diagram","generator","typescript","uml"],"created_at":"2026-01-17T19:01:42.482Z","updated_at":"2026-01-17T19:01:43.171Z","avatar_url":"https://github.com/demike.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"./assets/logo.png\" width=\"150\" align=\"right\" /\u003e\n\n# TsUML2 [![npm version](https://badge.fury.io/js/tsuml2.svg)](https://badge.fury.io/js/tsuml2) [![Known Vulnerabilities](https://snyk.io/test/npm/tsuml2/badge.svg)](https://snyk.io/test/npm/tsuml2)\n\nGenerate UML diagram for your TypeScript applications powered by nomnoml.\n\nTsUML2 works offline, so no third party servers are involved.\nIt supports\n- classes\n- interfaces\n- enums\n- type literals\n\n\n\n## Installation\n\n```sh\nnpm install -g tsuml2\n```\n\n## Usage\n\n```\ntsuml2 --glob \"./src/**/*.ts\" \n```\nBy default tsuml2 assumes that the required `tsconfig.json` file resides in the current directoy\nif this is not the case use the tsconfig parameter: \n```sh\n--tsconfig \"./somewhere/tsconfig.alt.json\"\n```\n\n\nTo avoid getting unwanted interfaces / classes you might want to exclude d.ts and spec.ts files:\n```sh\ntsuml2 --glob \"./src/**/!(*.d|*.spec).ts\"\n```\n\n### Options\n```\n      --help                Show help                                  [boolean]\n      --version             Show version number                        [boolean]\n  -g, --glob                pattern to match the source files (i.e.:\n                            ./src/**/*.ts)                   [string] [required]\n      --tsconfig            the path to tsconfig.json file\n  -o, --outFile             the path to the output file     [default: \"out.svg\"]\n      --propertyTypes       show property types and method return types\n                                                       [boolean] [default: true]\n      --modifiers           show modifiers like public,protected,private,static\n                                                       [boolean] [default: true]\n      --typeLinks           add links for classes, interface, enums that point\n                            to the source files        [boolean] [default: true]\n      --nomnoml             nomnoml layouting and styling options (an array of\n                            strings, each representing a nomnoml line), i.e.:\n                            --nomnoml \"#arrowSize: 1\" \"#.interface: fill=#8f8\n                            dashed\"                                      [array]\n      --outDsl              the path to the output DSL file (nomnoml)   [string]\n      --mermaid             mermaid layouting and styling options (an array of\n                            strings, each representing a mermaid line), i.e.:\n                            --mermaid \"direction LR\"                     [array]\n      --outMermaidDsl       the path to the output mermaid DSL file     [string]\n  -m, --memberAssociations  show associations between classes, interfaces, types\n                            and their member types    [boolean] [default: false]\n      --exportedTypesOnly   show only exported types, classes, interfaces, enums\n                                                      [boolean] [default: false]\n      --config              path to a json config file (command line options can\n                            be provided as keys in it)                  [string]\n```\n\nan example config.json could look like:\n```json\n{\n  \"glob\": \"./src/**/!(*.d|*.spec).ts\",\n  \"modifiers\": false,\n  \"nomnoml\": [\"#arrowSize: 1.5\",\"#.interface: fill=#8f8 dashed\"]\n}\n```\n\n\u003e **_NOTE:_** command line arguments override those provided in config.json\n\n## Direct output of nomnoml and mermaid code\nYou can output the diagram not only as svg but also\nas _nomnoml_ and _mermaid_ code.\n\n### Generate nomnoml DSL output\n\n```sh\ntsuml2 --glob \"./src/demo/**/*.ts\" --outDsl  \"./assets/nomnoml_diagram.dsl\"\n```\nresults in the following nomnoml code stored in `nomnoml_diagram.dsl`:\n```nomnoml\n#.interface: fill=lightblue\n#.enumeration: fill=lightgreen\n#.type: fill=lightgray\n[\u003cinterface\u003eWeapon||+tryHit(): boolean]\n[\u003cinterface\u003eNamed|+name: string|]\n[\u003cinterface\u003eMagic|+kind: string|]\n[\u003cinterface\u003eBlackMagic||+paintItBlack(): boolean]\n[\u003cinterface\u003eMagicWeapon\u003cMT\u003e|+magic: MT|+tryMagicHit(): boolean]\n[\u003cinterface\u003eBlackMagicWeapon||]\n[\u003cenumeration\u003eGender|Male;Female;Else]\n[\u003ctype\u003eMagicDurability|+fire: number;+water: number|]\n[\u003ctype\u003eDurable|+durability: number;+magicDurability: MagicDurability|+refresh(): void]\n[Magic]\u003c:--[BlackMagic]\n[Weapon]\u003c:--[MagicWeapon\u003cMT\u003e]\n[MagicWeapon\u003cMT\u003e]\u003c:--[BlackMagicWeapon]\n[BaseWeapon|#damage: number;+durability: number;+magicDurability: MagicDurability;+attributes: string\\[\\]|+refresh(): void]\n[Katana|+name: string|+tryHit(): boolean;+doIt(): void]\n[MagicKatana\u003cMT\u003e|+magic: MT|+tryMagicHit(): boolean]\n[BlackMagicKatana||+tryBlackMagicHit(): boolean]\n[Durable]\u003c:--[BaseWeapon]\n[BaseWeapon]\u003c:-[Katana]\n[Weapon]\u003c:--[Katana]\n[Named]\u003c:--[Katana]\n[Katana]\u003c:-[MagicKatana\u003cMT\u003e]\n[MagicWeapon\u003cMT\u003e]\u003c:--[MagicKatana\u003cMT\u003e]\n[MagicKatana\u003cMT\u003e]\u003c:-[BlackMagicKatana]\n[MagicWeapon\u003cMT\u003e]\u003c:--[BlackMagicKatana]\n[Ninja|+gender: Gender;+static IdCnt: number;-_weapon: Weapon;+id: number|+fight(): boolean]\n[Viking\u003cWT\u003e|+gender: Gender;+weapon: WT|+fight(): boolean]\n[UberViking\u003cWT\u003e||]\n[VikingWithKatana||]\n[Viking\u003cWT\u003e]\u003c:-[UberViking\u003cWT\u003e]\n[Viking\u003cWT\u003e]\u003c:-[VikingWithKatana]\n```\n\n### Generate mermaid DSL output\n\n```sh\ntsuml2 --glob \"./src/demo/**/*.ts\" --outMermaidDsl  \"./assets/mermaid_diagram.dsl\"\n```\nstores the mermaid code to `mermaid_diagram.dsl`.\n\n\u003e **_Note:_** You can use it directly in github markdown!\n\n```mermaid\n\nclassDiagram\nclass EquipmentPart~T~{\n            +id: string\n+name?: string\n+content?: T\n            +mount() void\n+unmount() void\n        }\nMountable~T~\u003c|..EquipmentPart~T~\nclass Weapon {\n            \u003c\u003cinterface\u003e\u003e\n            \n            +tryHit() boolean\n        }\nclass Named {\n            \u003c\u003cinterface\u003e\u003e\n            +name: string\n            \n        }\nclass Magic {\n            \u003c\u003cinterface\u003e\u003e\n            +kind: string\n            \n        }\nclass BlackMagic {\n            \u003c\u003cinterface\u003e\u003e\n            \n            +paintItBlack() boolean\n        }\nclass MagicWeapon~MT~ {\n            \u003c\u003cinterface\u003e\u003e\n            +magic: MT\n            +tryMagicHit() boolean\n        }\nclass BlackMagicWeapon {\n            \u003c\u003cinterface\u003e\u003e\n            \n            \n        }\nclass Attribute~T~ {\n            \u003c\u003cinterface\u003e\u003e\n            +id: string\n+value: T\n+description?: string\n            \n        }\nclass Mountable~T~ {\n            \u003c\u003cinterface\u003e\u003e\n            \n            +mount() void\n+unmount() void\n        }\nclass Gender {\n        \u003c\u003cenumeration\u003e\u003e\n        Male\nFemale\nElse\n      }\nclass MagicDurability {\n            \u003c\u003ctype\u003e\u003e\n            +fire: number\n+water: number\n            \n        }\nclass Durable {\n            \u003c\u003ctype\u003e\u003e\n            +durability: number\n+magicDurability: MagicDurability\n            +refresh() void\n        }\nMagic\u003c|..BlackMagic\nWeapon\u003c|..MagicWeapon~MT~\nMagicWeapon~MT~\u003c|..BlackMagicWeapon\nDurable  --  MagicDurability\nclass BaseWeapon{\n            #damage: number\n+durability: number\n+magicDurability: MagicDurability\n+attributes: Attribute~any~[]\n            +refresh() void\n        }\nclass Katana{\n            +name: string\n            +tryHit() boolean\n+doIt() void\n        }\nclass MagicKatana~MT~{\n            +magic: MT\n            +tryMagicHit() boolean\n        }\nclass BlackMagicKatana{\n            \n            +tryBlackMagicHit() boolean\n        }\nclass AttributeWithDefault~T~ {\n            \u003c\u003cinterface\u003e\u003e\n            +default: T\n            \n        }\nEquipmentPart~T~\u003c|--BaseWeapon\nDurable\u003c|..BaseWeapon\nBaseWeapon\u003c|--Katana\nWeapon\u003c|..Katana\nNamed\u003c|..Katana\nKatana\u003c|--MagicKatana~MT~\nMagicWeapon~MT~\u003c|..MagicKatana~MT~\nMagicKatana~MT~\u003c|--BlackMagicKatana\nMagicWeapon~MT~\u003c|..BlackMagicKatana\nAttribute~T~\u003c|..AttributeWithDefault~T~\nclass Ninja{\n            +gender: Gender\n+IdCnt: number$\n-_weapon: Weapon\n#secondaryWeapon?: Weapon\n-blockade?: Blockade\n+id: number\n            +fight() boolean\n        }\nclass Blockade {\n            \u003c\u003cinterface\u003e\u003e\n            +magic: number\n+physical: number\n            \n        }\nNinja  --  Gender\nNinja  --  Weapon\nNinja  --  Weapon\nclass Viking~WT~{\n            +age: (10 | 20)[]\n+gender: Gender\n+weapon: WT\n+secondaryWeapon?: WT\n+bag: EquipmentPart~any~[]\n            +fight() boolean\n        }\nclass UberViking~WT~{\n            +belt?: EquipmentPart~any~\n            \n        }\nclass VikingWithKatana{\n            \n            \n        }\nclass MagicViking{\n            +secondaryWeapon?: MagicKatana~BlackMagic~\n            \n        }\nViking~WT~\u003c|--UberViking~WT~\nViking~WT~\u003c|--VikingWithKatana\nViking~WT~\u003c|--MagicViking\nViking~WT~  --  Gender\n```\n\n## Usage in Node Applications:\n\n\n```js\n const {createDiagram, TsUML2Settings} = require('tsuml2')\n\n const settings = new TsUML2Settings();\n settings.glob = `./src/app/**/!(*.d|*.spec).ts`;\n settings.outFile = 'd:/apps/src/demo.svg'\n createDiagram(settings); \n```\n\n\n\n## Examples\n### Demo Diagram\n\n```sh\ntsuml2 --glob \"./src/demo/**/*.ts\" -o \"./assets/uml_diagram.svg\"\n```\n\nThe diagram generated for the code under the [demo folder](https://github.com/demike/TsUML2/tree/master/src/demo) looks as follows:\n\n![uml diagram example](/assets/uml_diagram.svg)\n\n### A complex command line parameter example:\n```\n./tsuml2 --glob=./src/demo/**/*.ts --nomnoml \"#arrowSize: 1.5\" \"#.interface: fill=#8f8 dashed\" --modifiers false --propertyTypes false\n```\n\n![alternative diagram style](/assets/alt_uml_diagram.svg)\n\n### With type links enabled: [live example](https://raw.githubusercontent.com/demike/TsUML2/master/assets/uml_diagram.svg)\n\n![type links](/assets/type_links.gif)\n\n\n### With member associations enabled:\nAssociations between class / interfaces / types and their members\nare represented by lines without arrows.\nThe associations also include multiplicity (\"0..*\").\n\nUse the `-m` parameter to enable output of member associations.\n \n```sh\ntsuml2 --glob \"./src/demo/**/*.ts\" -m -o \"./assets/uml_diagram.svg\"\n```\n\n![member associations](/assets/member_associations.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdemike%2Ftsuml2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdemike%2Ftsuml2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdemike%2Ftsuml2/lists"}