Es5 Function To Class Codemod Save

:package: Transform ES5 Functions to ES6 Classes

Project README

Transform ES5 Functions to ES6 Classes :package:

npm Awesome

Live Demo 💻

Features :100:

  • Methods on prototype
  • Static Methods on prototype
  • Variables and Literals on prototype
  • Getters, Setters with defineProperty
  • Block-level Variables

Sample Input 🛴 and Output :rocket:

input2

Complex example: Multiple functions in same file with one of the functions having same name.

Setup and Run :runner:

npm i -g jscodeshift
git clone --depth=1 https://github.com/dhruvdutt/es5-function-to-class-codemod codemod && cd codemod
jscodeshift -t func-to-class.js example/input.js
Similar project - lebab. It doesn't currently support:
  • Static Methods on prototype
  • Block-level Variables
Open Source Agenda is not affiliated with "Es5 Function To Class Codemod" Project. README Source: dhruvdutt/es5-function-to-class-codemod
Stars
31
Open Issues
3
Last Commit
4 years ago
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating