A backwards-\/compatible fs.\+realpath for Node v6 and above

In Node v6, the Java\+Script implementation of fs.\+realpath was replaced with a faster (but less resilient) native implementation. That raises new and platform-\/specific errors and cannot handle long or excessively symlink-\/looping paths.

This module handles those cases by detecting the new errors and falling back to the Java\+Script implementation. On versions of Node prior to v6, it has no effect.\hypertarget{md_sfcode_node_modules_fs_realpath_README_autotoc_md11074}{}\doxysection{USAGE}\label{md_sfcode_node_modules_fs_realpath_README_autotoc_md11074}

\begin{DoxyCode}{0}
\DoxyCodeLine{var rp = require('fs.realpath')}
\DoxyCodeLine{}
\DoxyCodeLine{// async version}
\DoxyCodeLine{rp.realpath(someLongAndLoopingPath, function (er, real) \{}
\DoxyCodeLine{  // the ELOOP was handled, but it was a bit slower}
\DoxyCodeLine{\})}
\DoxyCodeLine{}
\DoxyCodeLine{// sync version}
\DoxyCodeLine{var real = rp.realpathSync(someLongAndLoopingPath)}
\DoxyCodeLine{}
\DoxyCodeLine{// monkeypatch at your own risk!}
\DoxyCodeLine{// This replaces the fs.realpath/fs.realpathSync builtins}
\DoxyCodeLine{rp.monkeypatch()}
\DoxyCodeLine{}
\DoxyCodeLine{// un-\/do the monkeypatching}
\DoxyCodeLine{rp.unmonkeypatch() }

\end{DoxyCode}
 