# JSCodeshift
JSCodeshift API Doc (opens new window) (by crguezl, done with jscodeshift --version jscodeshift: 0.13.1 babel: 7.17.5 babylon: 7.17.3 flow: 0.172.0 recast: 0.20.5)
- JSCodeshift API Doc (opens new window) v0.3 obsolete
AST-Builder (opens new window) by Rasegar. My fork at https://github.com/ULL-ESIT-PL/ast-builder (opens new window), deployment at https://ull-esit-pl.github.io/ast-builder/ (opens new window)
Write Code to Rewrite Your Code: jscodeshift Examples: removing console.log, replacing imported method calls, from positional parameters to parameter object
jscodeshift cpojer/js-codemod no-vars.js Conservatively converts
var
toconst
orlet
.jscodeshift -t js-codemod/transforms/no-vars.js <file>
Effective Refactoring with Codemods - JS Monthly London - November 2018 (opens new window) Presented by Edd Yerburgh. Study case: substituting lodash
flatten
byarr.flat()
. YouTubeWriting codemods to change all your code at once (opens new window) by Sid. Case: Changing import a library whose name has changed. YouTube. 2018
Blog "Automating Code Transformation With jscodeshift" (opens new window) Jan 21, 2021, by Mark Skelton. Study case: removing imported variable
queryCache
from "react-query"
and importing it from a file in your project"common/queryClient"
# Rajasegar works
- AST-Builder (opens new window)
- Migrating large codebase with Codemods (opens new window) YouTube video. Talk at JSFoo Pune 2020. On component architecture, performance, security for front-end, and emerging trends. Rajasegar Chandran.
- Slides (opens new window)
- Awesome codemods (opens new window) at rajasegar/awesome-codemods
# Riki Fridrich
- Write a code that writes code (opens new window) talk by Riki Fridrich. Sep 22, 2021. WebExpo
- fczbkk/talk-2021-09-22-webexpo-codemod (opens new window) GitHub Repo
# ast-types and recast
- recast (opens new window)
- ast-types examples in crguezl/hello-ast-types (opens new window)
- api documentation for ast-types (v0.9.11) (opens new window) (Don't trust it. Current version is 0.15)
# Estraverse
- Estraverse README.md (opens new window)
- Simple examples of AST traversal and transformation crguezl/ast-traversal (opens new window)
# Repositorios interesantes de cowchimp
- A curated list of awesome AST resources
- AST Scout is a tool for analyzing and visualizing the relationship between the public API of a Class\Module and its implementations details (e.g. private methods, dependencies used).
- A web tool to explore the ASTs generated by various parsers. https://astexplorer.net/ The repo
# AST: Awesome Super Tool - JS Roundabout - April 2019
This is a talk similar to Yonatan Mevorach by Leonardo Crespo given in 2019:
- AST: Awesome Super Tool - JS Roundabout - April 2019 (opens new window) by Leonardo Crespo
# Wielding the powers of the JavaScript AST
by Kim Joar Bekkelund. September 14, 2017
JSCodeShift study case: Substitute Object.assign({}, a, b)
by {...a, ...b}
Wielding the powers of the JavaScript AST: Kim Joar Bekkelund from JavaZone on Vimeo.