Move files and directories.


\begin{DoxyCode}{0}
\DoxyCodeLine{const move = require('move-\/concurrently')}
\DoxyCodeLine{move('/path/to/thing', '/new/path/thing').then(() => \{}
\DoxyCodeLine{  // thing is now moved!}
\DoxyCodeLine{\}).catch(err => \{}
\DoxyCodeLine{  // oh no!}
\DoxyCodeLine{\}) }

\end{DoxyCode}


Uses {\ttfamily rename} to move things as fast as possible.

If you {\ttfamily move} across devices or on filesystems that don\textquotesingle{}t support renaming large directories. That is, situations that result in {\ttfamily rename} returning the {\ttfamily EXDEV} error, then {\ttfamily move} will fallback to copy + delete.

When recursively copying directories it will first try to rename the contents before falling back to copying. While this will be slightly slower in true cross-\/device scenarios, it is MUCH faster in cases where the filesystem can\textquotesingle{}t handle directory renames.

When copying ownership is maintained when running as root. Permissions are always maintained. On Windows, if symlinks are unavailable then junctions will be used.\hypertarget{md_sfcode_node_modules_move_concurrently_README_autotoc_md17854}{}\doxysection{INTERFACE}\label{md_sfcode_node_modules_move_concurrently_README_autotoc_md17854}
\hypertarget{md_sfcode_node_modules_move_concurrently_README_autotoc_md17855}{}\doxysubsection{move(from, to, options) → Promise}\label{md_sfcode_node_modules_move_concurrently_README_autotoc_md17855}
Recursively moves {\ttfamily from} to {\ttfamily to} and resolves its promise when finished. If {\ttfamily to} already exists then the promise will be rejected with an {\ttfamily EEXIST} error.

Starts by trying to rename {\ttfamily from} to {\ttfamily to}.

Options are\+:


\begin{DoxyItemize}
\item max\+Concurrency – (Default\+: {\ttfamily 1}) The maximum number of concurrent copies to do at once.
\item is\+Windows -\/ (Default\+: `process.\+platform === \textquotesingle{}win32'{\ttfamily ) If true enables Windows symlink semantics. This requires an extra}stat\`{} to determine if the destination of a symlink is a file or directory. If symlinking a directory fails then we\textquotesingle{}ll try making a junction instead.
\end{DoxyItemize}

Options can also include dependency injection\+:


\begin{DoxyItemize}
\item Promise -\/ (Default\+: {\ttfamily global.\+Promise}) The promise implementation to use, defaults to Node\textquotesingle{}s.
\item fs -\/ (Default\+: `require(\textquotesingle{}fs'){\ttfamily ) The filesystem module to use. Can be used to use}graceful-\/fs{\ttfamily or to inject a mock.}
\item {\ttfamily write\+Stream\+Atomic -\/ (Default\+:}require(\textquotesingle{}fs-\/write-\/stream-\/atomic\textquotesingle{}){\ttfamily ) The implementation of}write\+Stream\+Atomic{\ttfamily to use. Used to inject a mock.}
\item {\ttfamily getuid -\/ (Default\+:}process.\+getuid\`{}) A function that returns the current UID. Used to inject a mock. 
\end{DoxyItemize}