Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const glob = require("glob")
- const fs = require("fs-extra")
- const path = require("path")
- const globPaths = [
- "src/**/*.js",
- "test/**/*.js"
- ]
- globPaths.forEach(globPath => {
- glob(globPath, function (er, files) {
- files.forEach(file => {
- const dir = path.dirname(file)
- const filename = path.basename(file, ".js")
- fs.renameSync(path.resolve(file), path.resolve(dir, filename + ".ts"))
- })
- })
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement