code: function rename(source, destination) {
    const parent = path.dirname(destination);
    if (exists(destination)) {
      if (isDirectory(destination)) {
        destination = path.join(destination, path.basename(source));
      } else {
        if (isDirectory(source)) {
          throw new Error(`Cannot rename directory ${source} into existing file ${destination}`);
        }
      }
    } else if (!exists(parent)) {
      mkdir(parent);
    }
    try {
      fs.renameSync(source, destination);
    } catch (e) {
      if (e.code !== 'EXDEV') throw e;
      // Fallback for moving across devices
      copy(source, destination);
      fileDelete(source);
    }
  }
docs: Rename file or directory
  @function $file~rename
  @param {string} source
  @param {string} destination
  @example
  // Rename default configuration file
  $file.move('conf/php.ini-production', 'conf/php.ini');
   
  Alias of {@link $file~rename}
  @function $file~move