Skip to content

Instantly share code, notes, and snippets.

View frankllinoliveiraGM's full-sized avatar

Frankllin frankllinoliveiraGM

View GitHub Profile
@Reeska
Reeska / rename-js-to-jsx.js
Last active May 8, 2024 15:49
A script to convert .js to .jsx when they contains JSX tags
// node ./rename-js-to-jsx.js ./my/folder
const fs = require('fs')
const path = require('path')
// Options
const src = process.argv[2] ?? './'
const pattern = process.argv[3] ? new RegExp(`${process.argv[3]}$`) : /.js$/
const newExtension = process.argv[4] ?? '.jsx'