index.js
function reFile(filename, nfilename) {
    return new Promise(function (fulfill, reject) {
        fs.rename(filename, nfilename, function (err) {
            return err ? reject(err) : fulfill();
        });
    });
}
function reFile(filename, nfilename) {
    return new Promise(function (fulfill, reject) {
        fs.rename(filename, nfilename, function (err) {
            return err ? reject(err) : fulfill();
        });
    });
}
function reFile ( filename , nfilename ) { return new Promise ( function ( fulfill , reject ) { fs . rename ( filename , nfilename , function ( err ) { return err ? reject ( err ) : fulfill ( ) ; } ) ; } ) ; }
Rename the filename to nfilename. If nfilename and filename are not in the same physical path, the move file action will be triggered.
Asynchronous mode
@param {string} filename
@param {string} nfilename
@returns {*}
Rename the filename to nfilename . If nfilename and filename are not in the same physical path the move file action will be triggered . Asynchronous mode