Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let fs = require('fs');
- const path = './Kevin';
- fs.readdir(path, (err, items) => {
- if (err) console.log(err);
- else {
- items.forEach(oldFile => {
- const name = oldFile.split('Port');
- name[1] = name[1].split(' ').join('_');
- let newName = name.join('Port');
- fs.rename(oldFile, newName, err => {
- if (err) console.log(err);
- console.log('Kevin smd');
- });
- });
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement