@xoani, if you absolutely have to do this inside a function node using JavaScript, it is possible with a bit of effort. First, add
fs:require('fs')
to the functionGlobalContext object in your settings.js file. Then, in your function node, something like this should do the trick:
var fs = global.get('fs');
fs.rename('myfile', 'myrenamedfile', function (err) {
if (err) {
node.warn(err);
} else {
node.warn('File renamed');
}
})
The file names should be the complete path names, and you will need to be more serious about error handling.
This is described in the Writing Functions section of the documentation. Note that comments in the settings.js file suggest the deprecated usage, context.global instead of global.get. That probably still works.