Function moveSync

  • Moves a file or directory, even across devices.

    Parameters

    • src: string
    • dest: string

      Note: When src is a file, dest must be a file and when src is a directory, dest must be a directory.

    • Optional options: MoveOptions

    Returns void

    Example

    import * as fs from 'fs-extra'

    fs.moveSync('/tmp/somefile', '/tmp/does/not/exist/yet/somefile')

    // Using `overwrite` option
    fs.moveSync('/tmp/somedir', '/tmp/may/already/exist/somedir', { overwrite: true })

Generated using TypeDoc