Look up environment settings specific to different operating systems.\hypertarget{md_sfcode_node_modules_osenv_README_autotoc_md19262}{}\doxysection{Usage}\label{md_sfcode_node_modules_osenv_README_autotoc_md19262}

\begin{DoxyCode}{0}
\DoxyCodeLine{var osenv = require('osenv')}
\DoxyCodeLine{var path = osenv.path()}
\DoxyCodeLine{var user = osenv.user()}
\DoxyCodeLine{// etc.}
\DoxyCodeLine{}
\DoxyCodeLine{// Some things are not reliably in the env, and have a fallback command:}
\DoxyCodeLine{var h = osenv.hostname(function (er, hostname) \{}
\DoxyCodeLine{  h = hostname}
\DoxyCodeLine{\})}
\DoxyCodeLine{// This will still cause it to be memoized, so calling osenv.hostname()}
\DoxyCodeLine{// is now an immediate operation.}
\DoxyCodeLine{}
\DoxyCodeLine{// You can always send a cb, which will get called in the nextTick}
\DoxyCodeLine{// if it's been memoized, or wait for the fallback data if it wasn't}
\DoxyCodeLine{// found in the environment.}
\DoxyCodeLine{osenv.hostname(function (er, hostname) \{}
\DoxyCodeLine{  if (er) console.error('error looking up hostname')}
\DoxyCodeLine{  else console.log('this machine calls itself \%s', hostname)}
\DoxyCodeLine{\}) }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_osenv_README_autotoc_md19263}{}\doxysection{osenv.\+hostname()}\label{md_sfcode_node_modules_osenv_README_autotoc_md19263}
The machine name. Calls {\ttfamily hostname} if not found.\hypertarget{md_sfcode_node_modules_osenv_README_autotoc_md19264}{}\doxysection{osenv.\+user()}\label{md_sfcode_node_modules_osenv_README_autotoc_md19264}
The currently logged-\/in user. Calls {\ttfamily whoami} if not found.\hypertarget{md_sfcode_node_modules_osenv_README_autotoc_md19265}{}\doxysection{osenv.\+prompt()}\label{md_sfcode_node_modules_osenv_README_autotoc_md19265}
Either PS1 on unix, or PROMPT on Windows.\hypertarget{md_sfcode_node_modules_osenv_README_autotoc_md19266}{}\doxysection{osenv.\+tmpdir()}\label{md_sfcode_node_modules_osenv_README_autotoc_md19266}
The place where temporary files should be created.\hypertarget{md_sfcode_node_modules_osenv_README_autotoc_md19267}{}\doxysection{osenv.\+home()}\label{md_sfcode_node_modules_osenv_README_autotoc_md19267}
No place like it.\hypertarget{md_sfcode_node_modules_osenv_README_autotoc_md19268}{}\doxysection{osenv.\+path()}\label{md_sfcode_node_modules_osenv_README_autotoc_md19268}
An array of the places that the operating system will search for executables.\hypertarget{md_sfcode_node_modules_osenv_README_autotoc_md19269}{}\doxysection{osenv.\+editor()}\label{md_sfcode_node_modules_osenv_README_autotoc_md19269}
Return the executable name of the editor program. This uses the EDITOR and VISUAL environment variables, and falls back to {\ttfamily vi} on Unix, or {\ttfamily notepad.\+exe} on Windows.\hypertarget{md_sfcode_node_modules_osenv_README_autotoc_md19270}{}\doxysection{osenv.\+shell()}\label{md_sfcode_node_modules_osenv_README_autotoc_md19270}
The SHELL on Unix, which Windows calls the Com\+Spec. Defaults to \textquotesingle{}bash\textquotesingle{} or \textquotesingle{}cmd\textquotesingle{}. 