I have some files that I need to copy in another folder and then renaming all of them one by one. Is there any solution to rename all those files in the new folder one by one in synchronous way?
The function you're looking for is
fs.renameSync(old_file_path, new_file_path)
You can find it in the node documentation here
Remember you'll need to require in filesystem with const fs = require('fs')
as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With