\href{https://travis-ci.org/yargs/require-main-filename}{\texttt{ }} \href{https://coveralls.io/r/yargs/require-main-filename?branch=master}{\texttt{ }} \href{https://www.npmjs.com/package/require-main-filename}{\texttt{ }}

{\ttfamily require.\+main.\+filename} is great for figuring out the entry point for the current application. This can be combined with a module like \href{https://www.npmjs.com/package/pkg-conf}{\texttt{ pkg-\/conf}} to, {\itshape as if by magic}, load top-\/level configuration.

Unfortunately, {\ttfamily require.\+main.\+filename} sometimes fails when an application is executed with an alternative process manager, e.\+g., \href{https://github.com/tjanczuk/iisnode}{\texttt{ iisnode}}.

{\ttfamily require-\/main-\/filename} is a shim that addresses this problem.\hypertarget{md_sfcode_node_modules_require_main_filename_README_autotoc_md24363}{}\doxysection{Usage}\label{md_sfcode_node_modules_require_main_filename_README_autotoc_md24363}

\begin{DoxyCode}{0}
\DoxyCodeLine{var main = require('require-\/main-\/filename')()}
\DoxyCodeLine{// use main as an alternative to require.main.filename. }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_require_main_filename_README_autotoc_md24364}{}\doxysection{License}\label{md_sfcode_node_modules_require_main_filename_README_autotoc_md24364}
ISC 