{"id":28268576,"url":"https://github.com/catc/jscodeshift-debug","last_synced_at":"2025-06-16T20:31:58.409Z","repository":{"id":57299339,"uuid":"463256807","full_name":"catc/jscodeshift-debug","owner":"catc","description":"Debug utilities for jscodeshift","archived":false,"fork":false,"pushed_at":"2022-03-31T22:10:39.000Z","size":97,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-31T20:54:10.108Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/catc.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}},"created_at":"2022-02-24T18:20:40.000Z","updated_at":"2022-02-24T18:21:19.000Z","dependencies_parsed_at":"2022-08-26T18:12:14.379Z","dependency_job_id":null,"html_url":"https://github.com/catc/jscodeshift-debug","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catc%2Fjscodeshift-debug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catc%2Fjscodeshift-debug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catc%2Fjscodeshift-debug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catc%2Fjscodeshift-debug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/catc","download_url":"https://codeload.github.com/catc/jscodeshift-debug/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/catc%2Fjscodeshift-debug/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259239399,"owners_count":22826916,"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":"2025-05-20T15:13:02.448Z","updated_at":"2025-06-16T20:31:58.397Z","avatar_url":"https://github.com/catc.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## jscodeshift-debug\n\nDebug utilities for jscodeshift\n\n#### Usage:\nInstall\n```sh\nyarn add --dev jscodeshift-debug\n```\n\nAnd use\n```ts\nimport debug from 'jscodeshift-debug\n\ndebug(node) // or debug(nodepath)\n```\n\n\n#### Example\n\n```js\n// someFileToTransform.js\nimport sinon from 'sinon-sandbox'\n\nsinon.stub(I18n, 'extend');\n```\n\n```ts\nimport core, { API, FileInfo } from 'jscodeshift'\n\n// basic jscodeshift transformer\nexport default function transformer(fileInfo: FileInfo, api: API, options) {\n  const j = api.jscodeshift\n  const ast = j(fileInfo.source)\n  ast\n    .find(j.CallExpression, {\n      callee: {\n        type: 'MemberExpression',\n        property: {\n          type: 'Identifier',\n          name: 'stub',\n        },\n        object: {\n          type: 'Identifier',\n          name: 'sinon',\n        },\n      },\n    })\n    .forEach((nodepath) =\u003e {\n      // usage:\n      debug(np)\n    })\n}\n```\n\nWill log:\n```\nNode tree is:\n{\n  \"type\": \"CallExpression\",\n  \"callee\": {\n      \"type\": \"MemberExpression\",\n      \"object\": {\n          \"type\": \"Identifier\",\n          \"name\": \"sinon\"\n      },\n      \"property\": {\n          \"type\": \"Identifier\",\n          \"name\": \"stub\"\n      }\n  },\n  \"arguments\": [\n      {\n          \"type\": \"Identifier\",\n          \"name\": \"I18n\"\n      },\n      {\n          \"type\": \"Literal\",\n          \"value\": \"extend\"\n      }\n  ]\n} \n    \nNode to source:\n    \nsinon.stub(I18n, 'extend');\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatc%2Fjscodeshift-debug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcatc%2Fjscodeshift-debug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcatc%2Fjscodeshift-debug/lists"}