Moves a file or directory, even across devices.


\begin{DoxyItemize}
\item {\ttfamily src} {\ttfamily $<$String$>$}
\item {\ttfamily dest} {\ttfamily $<$String$>$}
\item {\ttfamily options} {\ttfamily $<$Object$>$}
\begin{DoxyItemize}
\item {\ttfamily overwrite} {\ttfamily $<$boolean$>$}\+: overwrite existing file or directory, default is {\ttfamily false}.
\end{DoxyItemize}
\item {\ttfamily callback} {\ttfamily $<$Function$>$}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_fs_extra_docs_move_autotoc_md11020}{}\doxysection{Example\+:}\label{md_sfcode_node_modules_fs_extra_docs_move_autotoc_md11020}

\begin{DoxyCode}{0}
\DoxyCodeLine{const fs = require('fs-\/extra')}
\DoxyCodeLine{}
\DoxyCodeLine{fs.move('/tmp/somefile', '/tmp/does/not/exist/yet/somefile', err => \{}
\DoxyCodeLine{  if (err) return console.error(err)}
\DoxyCodeLine{}
\DoxyCodeLine{  console.log('success!')}
\DoxyCodeLine{\})}
\DoxyCodeLine{}
\DoxyCodeLine{fs.move('/tmp/somefile', '/tmp/does/not/exist/yet/somefile')}
\DoxyCodeLine{.then(() => \{}
\DoxyCodeLine{  console.log('success!')}
\DoxyCodeLine{\})}
\DoxyCodeLine{.catch(err => \{}
\DoxyCodeLine{  console.error(err)}
\DoxyCodeLine{\}) }

\end{DoxyCode}


{\bfseries{Using {\ttfamily overwrite} option}}


\begin{DoxyCode}{0}
\DoxyCodeLine{const fs = require('fs-\/extra')}
\DoxyCodeLine{}
\DoxyCodeLine{fs.move('/tmp/somedir', '/tmp/may/already/existed/somedir', \{ overwrite: true \}, err => \{}
\DoxyCodeLine{  if (err) return console.error(err)}
\DoxyCodeLine{}
\DoxyCodeLine{  console.log('success!')}
\DoxyCodeLine{\}) }

\end{DoxyCode}
 