-1
I need to rescue some files with any name (Ex: "João") and rename them including a prefix ("RJ-João").
I managed to list but I’m not able to rename the files:
const testFolder = './teste/';
const fs = require('fs');
fs.readdir(testFolder, (err, files) => {
var arquivos = files.forEach(file => {
console.log( files );
});
I recommend that you explain why your solution (or how the code works) when answering a question to help understand who originally published the post.
– Ruan Montelo