compute the closest common parent directory among an array of directories\hypertarget{md_sfcode_node_modules_commondir_readme_autotoc_md5935}{}\doxysection{example}\label{md_sfcode_node_modules_commondir_readme_autotoc_md5935}

\begin{DoxyCode}{0}
\DoxyCodeLine{var commondir = require('commondir');}
\DoxyCodeLine{var dir = commondir(process.argv.slice(2))}
\DoxyCodeLine{console.log(dir); }

\end{DoxyCode}


output\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{\$ node dir.js /x/y/z /x/y /x/y/w/q}
\DoxyCodeLine{/x/y}
\DoxyCodeLine{\$ node ../baz ../../foo/quux ./bizzy}
\DoxyCodeLine{/foo }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_commondir_readme_autotoc_md5936}{}\doxysection{methods}\label{md_sfcode_node_modules_commondir_readme_autotoc_md5936}

\begin{DoxyCode}{0}
\DoxyCodeLine{var commondir = require('commondir'); }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_commondir_readme_autotoc_md5937}{}\doxysubsection{commondir(absolute\+Paths)}\label{md_sfcode_node_modules_commondir_readme_autotoc_md5937}
Compute the closest common parent directory for an array {\ttfamily absolute\+Paths}.\hypertarget{md_sfcode_node_modules_commondir_readme_autotoc_md5938}{}\doxysubsection{commondir(basedir, relative\+Paths)}\label{md_sfcode_node_modules_commondir_readme_autotoc_md5938}
Compute the closest common parent directory for an array {\ttfamily relative\+Paths} which will be resolved for each {\ttfamily dir} in {\ttfamily relative\+Paths} according to\+: {\ttfamily path.\+resolve(basedir, dir)}.\hypertarget{md_sfcode_node_modules_commondir_readme_autotoc_md5939}{}\doxysection{install}\label{md_sfcode_node_modules_commondir_readme_autotoc_md5939}
With \href{https://npmjs.org}{\texttt{ npm}} do\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{npm install commondir }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_commondir_readme_autotoc_md5940}{}\doxysection{license}\label{md_sfcode_node_modules_commondir_readme_autotoc_md5940}
MIT 