{"id":16813055,"url":"https://github.com/gszr/lua-call-graph","last_synced_at":"2026-02-13T06:42:21.956Z","repository":{"id":226756434,"uuid":"769569371","full_name":"gszr/lua-call-graph","owner":"gszr","description":"Generate the call graph of a Lua program","archived":false,"fork":false,"pushed_at":"2025-02-08T18:10:37.000Z","size":22,"stargazers_count":2,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-10-10T19:34:06.756Z","etag":null,"topics":["call-graph","callgraph","lua"],"latest_commit_sha":null,"homepage":"","language":"Lua","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/gszr.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,"zenodo":null}},"created_at":"2024-03-09T12:58:47.000Z","updated_at":"2025-02-08T18:10:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"64c4e179-1d6c-4249-b8e1-e20333d76514","html_url":"https://github.com/gszr/lua-call-graph","commit_stats":null,"previous_names":["gszr/lua-call-graph"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/gszr/lua-call-graph","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gszr%2Flua-call-graph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gszr%2Flua-call-graph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gszr%2Flua-call-graph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gszr%2Flua-call-graph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gszr","download_url":"https://codeload.github.com/gszr/lua-call-graph/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gszr%2Flua-call-graph/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29398144,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T06:24:03.484Z","status":"ssl_error","status_checked_at":"2026-02-13T06:23:12.830Z","response_time":78,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["call-graph","callgraph","lua"],"created_at":"2024-10-13T10:24:28.680Z","updated_at":"2026-02-13T06:42:21.939Z","avatar_url":"https://github.com/gszr.png","language":"Lua","readme":"# Lua Call Graph\n\nGenerate a call graph of Lua programs.\n\n## API\n\n### new\n\nCreate new capture instance.\n\n**syntax**: graph.new(cfg)\n\nSupported configs:\n* `name`: call graph name\n* `filename`: name for the call graph `.dot` file (defaults to `name`)\n* `ignores`: an array of function names to redact from the `.dot` file\n* `separator`: the character to use as separator for spaces[^1]\n* `mappings`: a translation map of function names; if a function mamed `key` is\n  found, it's renamed with `value`\n\n[^1]: Some internal function names might contain spaces. For example, `for iterator`.\nThe `separator` value will be used to replace these spaces.\n\n### :capture\n\n**syntax**: *graph:capture()*\n\nStarts capturing the call graph from that point in the program.\n\n### :stop\n\n**syntax**: graph:stop()\n\nStops capturing the call graph. A subsequent call to `:emit` generates the\ncall graph.\n\n### :emit\n\n**syntax**: *graph:emit()*\n\nEmits the captured call graph named `name` into the DOT file `filename`.\n\n## Example\n\nGiven the Lua code below\n```lua\nlocal callgraph = require\"callgraph\"\n\nfunction a()\n  b()\nend\n\nfunction b()\n  c()\n  print()\nend\n\nfunction c()\n  local t = {\"a\", \"b\"}\n  for _, _ in pairs(t) do end\n  d()\nend\n\nfunction d()\n  print(\"\")\nend\n\nlocal g = callgraph.new({\n  name = \"callgraph\",\n  filename = \"graph.dot\",\n  ignores = {\"something\"},\n})\n\ng:capture()\npcall(a) -- this one is found\npcall(function() end) -- this one cannot be found - so shows as unknown\ng:stop()\nc()\ng:emit()\n```\n\nthe library outputs the following call graph:\n\n![call graph](./test/graph.svg)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgszr%2Flua-call-graph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgszr%2Flua-call-graph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgszr%2Flua-call-graph/lists"}