node-fs-extra/docs/move-sync.md
2017-03-08 13:38:57 -08:00

424 B

moveSync(src, dest, [options])

Moves a file or directory, even across devices.

Options:

  • overwrite (boolean): overwrite existing file or directory, default is false

Example:

const fs = require('fs-extra')

fs.moveSync('/tmp/somefile', '/tmp/does/not/exist/yet/somefile')
const fs = require('fs-extra')

fs.moveSync('/tmp/somedir', '/tmp/may/already/existed/somedir', { overwrite: true })