{"id":13532049,"url":"https://github.com/dhruvdutt/es5-function-to-class-codemod","last_synced_at":"2025-04-01T20:31:15.845Z","repository":{"id":57242897,"uuid":"128511524","full_name":"dhruvdutt/es5-function-to-class-codemod","owner":"dhruvdutt","description":":package: Transform ES5 Functions to ES6 Classes","archived":false,"fork":false,"pushed_at":"2019-06-20T18:37:33.000Z","size":13,"stargazers_count":33,"open_issues_count":3,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T09:03:03.502Z","etag":null,"topics":["codemod","es5","es6","javascript","jscodeshift"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/dhruvdutt.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":"2018-04-07T08:50:28.000Z","updated_at":"2025-03-04T12:18:28.000Z","dependencies_parsed_at":"2022-09-15T01:33:54.162Z","dependency_job_id":null,"html_url":"https://github.com/dhruvdutt/es5-function-to-class-codemod","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhruvdutt%2Fes5-function-to-class-codemod","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhruvdutt%2Fes5-function-to-class-codemod/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhruvdutt%2Fes5-function-to-class-codemod/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhruvdutt%2Fes5-function-to-class-codemod/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dhruvdutt","download_url":"https://codeload.github.com/dhruvdutt/es5-function-to-class-codemod/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246709923,"owners_count":20821297,"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":["codemod","es5","es6","javascript","jscodeshift"],"created_at":"2024-08-01T07:01:07.815Z","updated_at":"2025-04-01T20:31:10.834Z","avatar_url":"https://github.com/dhruvdutt.png","language":"JavaScript","funding_links":[],"categories":["Table of Contents","JavaScript"],"sub_categories":["Codemods"],"readme":"# Transform ES5 Functions to ES6 Classes :package:\n\n[![npm](https://img.shields.io/npm/v/func-to-classes.svg)](https://www.npmjs.com/package/func-to-classes)\n[![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sejoker/awesome-jscodeshift#codemods)\n\n### [Live Demo](https://astexplorer.net/#/gist/855cc00b6ebfe60f53b2c0543482ee92/) 💻\n\n#### Features :100:\n- [x] Methods on `prototype`\n- [x] Static Methods on `prototype`\n- [x] Variables and Literals on `prototype`\n- [x] Getters, Setters with `defineProperty`\n- [x] Block-level Variables\n\n#### Sample Input 🛴 and Output :rocket:\n![input2](https://user-images.githubusercontent.com/5961873/38467870-ae616014-3b5b-11e8-8b92-87bdde827546.png)\n\n[Complex example](https://astexplorer.net/#/gist/541ba10e75228eeb83ccf95589b0bd76): Multiple functions in same file with one of the functions having same name.\n\n#### Setup and Run :runner:\n\n```bash\nnpm i -g jscodeshift\ngit clone --depth=1 https://github.com/dhruvdutt/es5-function-to-class-codemod codemod \u0026\u0026 cd codemod\njscodeshift -t func-to-class.js example/input.js\n```\n\n##### Similar project - [lebab](https://uniibu.github.io/lebab-ce/). It doesn't currently support:\n  - [ ] Static Methods on `prototype`\n  - [ ] Block-level Variables\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhruvdutt%2Fes5-function-to-class-codemod","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdhruvdutt%2Fes5-function-to-class-codemod","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhruvdutt%2Fes5-function-to-class-codemod/lists"}