jscodeshift is a toolkit for running codemods over multiple JavaScript or TypeScript files. It provides A runner, which executes the provided transform for each file passed to it. It also outputs a summary of how many files have (not) been transformed. A wrapper around recast, providing a different API. Recast is an AST-to-AST transform tool and also tries to preserve the style of original code as much as possible. As already mentioned, jscodeshift also provides a wrapper around recast. In order to properly use the jscodeshift API, one has to understand the basic building blocks of recast (and ASTs) as well. An AST node is a plain JavaScript object with a specific set of fields, in accordance with the Mozilla Parser API. The primary way to identify nodes is via their type. It's OK to not know the structure of every AST node type. The (esprima) AST explorer is an online tool to inspect the AST for a given piece of JS code.

Features

  • Get jscodeshift from npm
  • The CLI provides the a wide variety of options
  • The transform is simply a module that exports a function of the form
  • Holds information about the currently processed file
  • This object exposes the jscodeshift library and helper functions from the runner
  • This API is exposed for convenience, but you don't have to use it

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow jscodeshift

jscodeshift Web Site

You Might Also Like
Automated quote and proposal software for IT solution providers. | ConnectWise CPQ Icon
Automated quote and proposal software for IT solution providers. | ConnectWise CPQ

Create IT quote templates, automate workflows, add integrations & price catalogs to save time & reduce errors on manual data entry & updates.

ConnectWise CPQ, formerly ConnectWise Sell, is a professional quote and proposal automation software for IT solution providers. ConnectWise CPQ offers a wide range of tools that enables IT solution providers to save time, quote more, and win big. Top features include professional quote or proposal templates, product catalog and sourcing, workflow automation, sales reporting, and integrations with best-in-breed solutions like Cisco, Dell, HP, and Salesforce.
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of jscodeshift!

Additional Project Details

Programming Language

JavaScript

Related Categories

JavaScript Source Code Analysis Tool, JavaScript Libraries

Registered

2021-08-20