{"id":13532031,"url":"https://github.com/5to6/5to6-codemod","last_synced_at":"2025-04-01T20:31:14.659Z","repository":{"id":3138707,"uuid":"48445151","full_name":"5to6/5to6-codemod","owner":"5to6","description":"A collection of codemods that allow you to transform your js code from ES5 to ES6.","archived":false,"fork":false,"pushed_at":"2023-01-03T18:55:01.000Z","size":606,"stargazers_count":302,"open_issues_count":25,"forks_count":36,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-02T05:19:01.443Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://medium.com/@cpojer/effective-javascript-codemods-5a6686bb46fb","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/5to6.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-22T17:29:04.000Z","updated_at":"2025-01-31T03:13:35.000Z","dependencies_parsed_at":"2023-01-13T12:18:37.696Z","dependency_job_id":null,"html_url":"https://github.com/5to6/5to6-codemod","commit_stats":null,"previous_names":["5to6/codemod"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5to6%2F5to6-codemod","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5to6%2F5to6-codemod/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5to6%2F5to6-codemod/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5to6%2F5to6-codemod/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/5to6","download_url":"https://codeload.github.com/5to6/5to6-codemod/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246709923,"owners_count":20821297,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T07:01:07.684Z","updated_at":"2025-04-01T20:31:09.636Z","avatar_url":"https://github.com/5to6.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","others","By Environment","Table of Contents"],"sub_categories":["JavaScript/TypeScript","Codemods"],"readme":"[![Build Status](https://travis-ci.org/5to6/5to6-codemod.svg)](https://travis-ci.org/5to6/5to6-codemod)\n[![GitHub version](https://img.shields.io/github/tag/5to6/5to6-codemod.svg)](https://github.com/5to6/5to6-codemod)\n[![NPM version](https://img.shields.io/npm/v/5to6-codemod.svg)](https://www.npmjs.com/package/5to6-codemod)\n[![Downloads](https://img.shields.io/npm/dm/5to6-codemod.svg)](https://www.npmjs.com/package/5to6-codemod)\n\n# 5to6-codemod\n\nA collection of [codemods](https://medium.com/@cpojer/effective-javascript-codemods-5a6686bb46fb) that allow you to transform your JavaScript code from ES5 to ES6 using [jscodeshift](https://github.com/facebook/jscodeshift).\n\n## Usage\n\n1. `npm install -g jscodeshift`\n2. `npm install 5to6-codemod`\n3. `jscodeshift -t node_modules/5to6-codemod/transforms/[transform].js [files]`\n4. Review changes via `git diff`. Keep what you want, throw it out if you don't. Magic!\n\n## Option flags\n\nWhen executing codemods, you can configure options like so:\n\n`jscodeshift -t node_modules/5to6-codemod/transforms/[transform].js [files] --key=value`\n\n### Recast options\n\nOur transforms will automatically distinguish and pass through Recast config keys via [jscodeshift](https://github.com/facebook/jscodeshift#passing-options-to-recast). Official documentation for Recast's configuration can be found [here](https://github.com/benjamn/recast/blob/4899a70d4b9aeec9c599065be3338464b7047767/lib/options.js#L1). We currently support the following Recast keys:\n- `esprima`\n- `inputSourceMap`\n- `lineTerminator`\n- `quote`\n- `range`\n- `reuseWhitespace`\n- `sourceFileName`\n- `sourceMapName`\n- `sourceRoot`\n- `tabWidth`\n- `tolerant`\n- `trailingComma`\n- `useTabs`\n- `wrapColumn`\n\n## Transforms\n\n- `amd` - Transforms AMD style modules to ES6 `import`/`export`\n- `cjs` - Transforms CommonJS style `require()` calls to ES6 `import` statements\n\t- This transformation accepts the following option flags:\n\t\t- `hoist`: Enables hoisting require statements to the top\n- `no-strict` - Removes \"use strict\" statements\n- `exports` - Move CommonJS style `module.exports` statements to ES6 `export` statements\n- `named-export-generation` - Adds named exports corresponding to default export object keys. Only valid for ES6 modules exporting an object as the default export.\n- `let` - Replace all `var` calls to use `let`\n- `simple-arrow` - Replace all function expressions with a body of a sole return statement into arrow functions\n\n## Known issues\n\n* Can't automagically figure out when you want to use `import * as varName`.\n* End-of-line comments also missing in many situations\n* `simple-arrow` loses comments in the function expression body\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F5to6%2F5to6-codemod","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F5to6%2F5to6-codemod","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F5to6%2F5to6-codemod/lists"}