Advertisement
Guest User

Untitled

a guest
Sep 17th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. const glob = require("glob")
  2. const fs = require("fs-extra")
  3. const path = require("path")
  4.  
  5. const globPaths = [
  6. "src/**/*.js",
  7. "test/**/*.js"
  8. ]
  9.  
  10. globPaths.forEach(globPath => {
  11. glob(globPath, function (er, files) {
  12. files.forEach(file => {
  13. const dir = path.dirname(file)
  14. const filename = path.basename(file, ".js")
  15. fs.renameSync(path.resolve(file), path.resolve(dir, filename + ".ts"))
  16. })
  17. })
  18. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement