https://github.com/macklinu/codemods
A collection of JavaScript codemod scripts for easier code migration
https://github.com/macklinu/codemods
codemod jscodeshift
Last synced: 28 days ago
JSON representation
A collection of JavaScript codemod scripts for easier code migration
- Host: GitHub
- URL: https://github.com/macklinu/codemods
- Owner: macklinu
- Created: 2018-05-11T23:33:09.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2019-04-16T19:55:09.000Z (about 7 years ago)
- Last Synced: 2025-03-01T14:32:34.498Z (over 1 year ago)
- Topics: codemod, jscodeshift
- Language: JavaScript
- Homepage:
- Size: 137 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @macklinu/codemods
> A collection of JavaScript and TypeScript codemod scripts for easier code migration
## Scripts
All scripts should be executed with Node >=22.
### `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:
```sh
npx jscodeshift -t https://raw.githubusercontent.com/macklinu/codemods/master/src/requirejs-to-commonjs.js
```
## Development
### `bun run test`
Runs the [Vitest](https://vitest.dev/) test suite.
### `bun run lint`
Runs [ESLint](https://eslint.org/).
## Contributing
If you use any of these codemods and have bug reports / feature requests, please
[open an issue](https://github.com/macklinu/codemods/issues/new)!