{"id":13670892,"url":"https://github.com/brendankenny/call-trace","last_synced_at":"2025-03-19T02:32:03.127Z","repository":{"id":146182746,"uuid":"51510718","full_name":"brendankenny/call-trace","owner":"brendankenny","description":null,"archived":false,"fork":false,"pushed_at":"2024-03-01T01:50:53.000Z","size":22,"stargazers_count":36,"open_issues_count":2,"forks_count":9,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-19T00:42:43.166Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brendankenny.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}},"created_at":"2016-02-11T11:34:03.000Z","updated_at":"2024-08-21T11:30:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"310d9941-0109-43c0-805a-6f233e54a6f3","html_url":"https://github.com/brendankenny/call-trace","commit_stats":{"total_commits":19,"total_committers":2,"mean_commits":9.5,"dds":"0.052631578947368474","last_synced_commit":"11d348bb63c22f66417cfc7b8492c9e674777681"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brendankenny%2Fcall-trace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brendankenny%2Fcall-trace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brendankenny%2Fcall-trace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brendankenny%2Fcall-trace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brendankenny","download_url":"https://codeload.github.com/brendankenny/call-trace/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243960664,"owners_count":20375104,"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","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-08-02T09:00:52.218Z","updated_at":"2025-03-19T02:32:02.864Z","avatar_url":"https://github.com/brendankenny.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","DevTools tooling and ecosystem"],"sub_categories":["CPU profile"],"readme":"# call-trace.js\n\nInstruments a JavaScript file to record its call graph and (optionally) time spent in each function. When the file is run in the browser, a trace can be converted to the Chrome CPU profile format for viewing in DevTools.\n\n_**Super buggy and doesn't work for most fairly normal code. Don't actually use this :)**_\n\n#### Usage:\n\n```\n./call-trace.js input.js --time \u003e output.js\n```\nWhen the output is loaded and then run, a global variable `_$wɔk` is created containing a trace through the code you just ran.\n\nA CPU profile can be generated from the trace:\n```\ncopy(JSON.stringify(_$wɔk.getReport()))\n```\nThen save your clipboard contents and load in Chrome DevTools.\n\n![image](https://cloud.githubusercontent.com/assets/39191/13341642/5fa65768-dbef-11e5-8ae9-5d0896e2c895.png)\n\n#### Exploring the data\n\nThe global variable `_$wɔk` also has the following properties:\n- `file`: the full path of the original source file.\n- `fns`: a list of all functions found in the file.\n- `t`: a record of the call graph. Positive values represent entering a function (with the value indicating a function in `f`) and negative values represent exiting a function (with the absolute value indexing `f`).\n- `d`: a record of timestamps for every entry in `t`. Only created if the `--time` option was specified.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrendankenny%2Fcall-trace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrendankenny%2Fcall-trace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrendankenny%2Fcall-trace/lists"}