When writing node.\+js code that must support Windows and $\ast$nix OSes, it is sometimes frustrating that path segments are separated differently depending upon the environment.

Ironically, we can pass in paths with either separator and the library will normalize it to the current OS\textquotesingle{}s format. But it then returns paths using the current OS\textquotesingle{}s separator.

This utility simple wraps the built-\/in {\ttfamily path} library such that it only ever returns path segments separated by forward slashes (/).\hypertarget{md_sfcode_node_modules_canonical_path_README_autotoc_md5033}{}\doxysection{Installation}\label{md_sfcode_node_modules_canonical_path_README_autotoc_md5033}

\begin{DoxyCode}{0}
\DoxyCodeLine{npm install -\/-\/save canonical-\/path }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_canonical_path_README_autotoc_md5034}{}\doxysection{Usage}\label{md_sfcode_node_modules_canonical_path_README_autotoc_md5034}

\begin{DoxyCode}{0}
\DoxyCodeLine{var path = require('canonical-\/path');}
\DoxyCodeLine{}
\DoxyCodeLine{var p = path.normalize('a/b/../c');}
\DoxyCodeLine{// p === 'a/c'; }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_canonical_path_README_autotoc_md5035}{}\doxysection{Testing}\label{md_sfcode_node_modules_canonical_path_README_autotoc_md5035}

\begin{DoxyCode}{0}
\DoxyCodeLine{npm test }

\end{DoxyCode}
 