Skip to content

ArnaudSpanneut/codemod-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

codemod-example

This repository is an use case set up for the article:

It shows how to work with jscodeshift.

You can find:

  • src/HelloWorld.js: Source file
  • codemod/transform.js: Codemod

🛠 Installation

yarn
# or
npm install

⚡️ Run

Transform the code runing:

npx jscodeshift -t codemod/transform.js src/HelloWorld.js
  • -t codemod/refactor.js is for the path to the transformation file.
  • src/HelloWorld.js is the file we want to transform (you can use)

Tada, your file has been transformed 🎉