{"id":13532445,"url":"https://github.com/vasco3/cuadrante-codemods","last_synced_at":"2025-04-01T20:32:12.666Z","repository":{"id":79161228,"uuid":"65685410","full_name":"vasco3/cuadrante-codemods","owner":"vasco3","description":"Code modifiers using jscodeshift","archived":false,"fork":false,"pushed_at":"2017-03-04T20:51:16.000Z","size":9,"stargazers_count":4,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T06:45:42.316Z","etag":null,"topics":["codemod","cuadrante-codemods","ecmascript","es6-modules","jscodeshift"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/cuadrante-codemods","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vasco3.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-08-14T20:38:45.000Z","updated_at":"2021-06-15T05:16:29.000Z","dependencies_parsed_at":"2023-08-31T04:40:17.610Z","dependency_job_id":null,"html_url":"https://github.com/vasco3/cuadrante-codemods","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vasco3%2Fcuadrante-codemods","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vasco3%2Fcuadrante-codemods/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vasco3%2Fcuadrante-codemods/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vasco3%2Fcuadrante-codemods/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vasco3","download_url":"https://codeload.github.com/vasco3/cuadrante-codemods/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":["codemod","cuadrante-codemods","ecmascript","es6-modules","jscodeshift"],"created_at":"2024-08-01T07:01:11.002Z","updated_at":"2025-04-01T20:32:07.649Z","avatar_url":"https://github.com/vasco3.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# cuadrante-codemods\n\n[![Known Vulnerabilities](https://snyk.io/test/github/vasco3/cuadrante-codemods/badge.svg)](https://snyk.io/test/github/vasco3/cuadrante-codemods)\n\nCode modifiers using jscodeshift\n\n\u003e Thanks to Node v6 now we don't need babel to run ES2015 in our servers.\n\u003e In that case, if you don't trading off the nice ES2015 modules for good old\n\u003e commonJS, you can run this script to liberate your server from a build process.\n\n## Requirements\n\n- Node v6+\n- npm install -g jscodeshift\n\n## Usage\n\n- `cd` into your project directory\n- `npm install cuadrante-codemods`\n- `jscodeshift -t \u003ccodemod-script\u003e \u003cpath\u003e`\n\n## Example\n\nUsing `find` to loop through al the javascript files\n\n- `find . -name '*.js' -print | xargs jscodeshift -t node_modules/cuadrante-codemods/lib/es2015modules-to-commonjs.js`\n\nWill do the following\n\n```diff\n-import fs from 'fs'\n+const fs = require('fs');\n\n-import {getWhatever, findWhatever} from 'library'\n+const {getWhatever, findWhatever} = require('library');\n\n-import settings from './settings';\n+const settings = require('./settings');\n\n-import homeRoute from './routes/home';\n+const homeRoute = require('./routes/home');\n\n-import App from './routes/App';\n+const App = require('./routes/App');\n\n-import stockOptionsGameRoute from './routes/stock-options-game';\n+const stockOptionsGameRoute = require('./routes/stock-options-game');\n\n-export function wawa() { return 0;  }\n+exports.wawa = function wawa() {\n+  return 0;\n+};\n\n-export default (req, res) =\u003e { return true }\n+module.exports = (req, res) =\u003e {\n+  return true\n+};\n\n-export const MARKER_REMOVED_OUT = 'MARKER_REMOVED_OUT';\n+exports.MARKER_REMOVED_OUT = 'MARKER_REMOVED_OUT';\n```\n\n\n## Explore\n\nwww.astexplorer.net\nparser: Recast\ntransformer: jscodeshift\n\n### AST Types\n\nLook for the builder method\n\nhttps://github.com/benjamn/ast-types\n\n## Inspiration\n\n- [Converts commonJS requires to es6 imports](https://gist.github.com/dmnd/12cad812c3f969e4f76c)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvasco3%2Fcuadrante-codemods","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvasco3%2Fcuadrante-codemods","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvasco3%2Fcuadrante-codemods/lists"}