happy-opfs
    Preparing search index...

    Function move

    • Moves a file or directory from one location to another. Both source and destination must be of the same type (both files or both directories).

      Parameters

      • srcPath: string

        The absolute source path.

      • destPath: string

        The absolute destination path.

      • Optionaloptions: MoveOptions

        Optional move options.

        Options for move.

        • Optionaloverwrite?: boolean

          Whether to overwrite the destination file if it already exists.

          true

      Returns AsyncVoidIOResult

      A promise that resolves to an AsyncVoidIOResult indicating success or failure.

      1.8.0

      copy for copying instead of moving

      // Move/rename a file
      await move('/old/path/file.txt', '/new/path/file.txt');

      // Move a directory
      await move('/old/folder', '/new/folder');