Skip to content

A collection of JavaScript codemod scripts for easier code migration

Notifications You must be signed in to change notification settings

macklinu/codemods

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@macklinu/codemods

A collection of JavaScript codemod scripts for easier code migration

code style: prettier Build Status

Scripts

All scripts should be executed with Node >=8.

requirejs-to-commonjs

Converts AMD modules (define()) to CommonJS modules (module.exports). This codemod currently only handles converting AMD define() statements - global AMD require() modification is not supported.

To run:

npx jscodeshift <files-or-glob> -t https://raw.githubusercontent.com/macklinu/codemods/master/src/requirejs-to-commonjs.js

Development

yarn test

Runs the Jest test suite. Tip: run yarn test --watch for interactive watch mode during development.

Jest also includes an ESLint runner, so running yarn test will lint and test all source files.

Contributing

If you use any of these codemods and have bug reports / feature requests, please open an issue!

About

A collection of JavaScript codemod scripts for easier code migration

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published