{"id":32517294,"url":"https://github.com/mrmurphy/lunchjs-codemods","last_synced_at":"2026-07-04T02:33:01.471Z","repository":{"id":144898805,"uuid":"43932619","full_name":"mrmurphy/lunchjs-codemods","owner":"mrmurphy","description":"An example repo for a talk about codemods","archived":false,"fork":false,"pushed_at":"2015-10-09T04:33:36.000Z","size":120,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-07-04T02:32:59.868Z","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/mrmurphy.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":"2015-10-09T04:18:39.000Z","updated_at":"2015-10-12T22:30:44.000Z","dependencies_parsed_at":"2023-04-09T07:15:31.548Z","dependency_job_id":null,"html_url":"https://github.com/mrmurphy/lunchjs-codemods","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mrmurphy/lunchjs-codemods","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrmurphy%2Flunchjs-codemods","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrmurphy%2Flunchjs-codemods/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrmurphy%2Flunchjs-codemods/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrmurphy%2Flunchjs-codemods/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrmurphy","download_url":"https://codeload.github.com/mrmurphy/lunchjs-codemods/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrmurphy%2Flunchjs-codemods/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35108298,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-04T02:00:05.987Z","response_time":113,"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":"2025-10-28T02:54:49.004Z","updated_at":"2026-07-04T02:33:01.465Z","avatar_url":"https://github.com/mrmurphy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Codemods - Lunch JS Talk\n\nThis is a tiny sample repository to show off the technique of modifying source\ncode through its AST.\n\n# Running\n\n`npm install`\n\n`npm run peek` - This will perform a dry run on the codemods in ./transform.js\nand print the result to stdio. This is great for writing new mods.\n`npm run` - This will run the mods and actually leave the source files changed\non disk. Don't worry! You can always discard the changes with git!\n\n# Resources\n\n[JS Codeshift](https://github.com/facebook/jscodeshift)\n\ncodeshift is the tool you will actually run. It provides a CLI, and it wraps the\nnext two libraries listed here with some convenience functions for finding nodes\nin the tree.\n\n[AST Types](https://github.com/benjamn/ast-types)\n\nThis repo is where you'll want to do all of your searching to find out how to\ndefine new nodes. Here are some hints:\n\n- Names that start with a lower-case letter (e.g. `variableDeclaration`) are\nconstructor functions and will construct a new node when called with arguments\n- Names that start with an upper-case letter (e.g. `VariableDeclaration` are\nobjects, and can be passed to src.find() in order to find nodes of that same type)\n- To find out how a constructor for a type should be called, search its name in\nthe ast-types codebase, and then find where `def` is called on the top-level of the\nfile with that typename as an argument. (example: https://github.com/benjamn/ast-types/blob/8baed603a84e4404f952f75fcf36a6a00a25495a/def/esprima.js#L8)\n\n[Recast](https://github.com/benjamn/recast)\n\nNot too much you need to learn about with Recast. It does a nice job of reconstructing\nwell formatted javascript from the AST.\n\n[AST Explorer](http://felix-kling.de/esprima_ast_explorer/)\n\nAST Explorer is a terribly valuable tool for figuring out how different parsers turn your\ncode into an AST. You'll definitely want to keep this at hand while writing new mods.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrmurphy%2Flunchjs-codemods","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrmurphy%2Flunchjs-codemods","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrmurphy%2Flunchjs-codemods/lists"}