fs.move

fs.move

fs.move

Function

Move the current file or directory to the target directory, keeping the file name unchanged.

Syntax

Parameters

ParametersTypeRequiredDefault valueDescription
dirStringYesNoneThe target directory.

Return value

TypeDescription
FsReturns the fs object bound to the moved path.

Example

Notes

  • The target directory will be automatically created if it does not exist.
  • move uses the original file name as the target file name.