\href{https://www.npmjs.com/package/is-resolvable}{\texttt{ }} \href{https://travis-ci.org/shinnn/is-resolvable}{\texttt{ }} \href{https://ci.appveyor.com/project/ShinnosukeWatanabe/is-resolvable}{\texttt{ }} \href{https://coveralls.io/r/shinnn/is-resolvable}{\texttt{ }}

A \href{https://nodejs.org/}{\texttt{ Node.\+js}} module to check if a given module ID is resolvable with \href{https://nodejs.org/api/globals.html\#globals_require}{\texttt{ {\ttfamily require()}}}


\begin{DoxyCode}{0}
\DoxyCodeLine{const isResolvable = require('is-\/resolvable');}
\DoxyCodeLine{}
\DoxyCodeLine{isResolvable('fs'); //=> true}
\DoxyCodeLine{isResolvable('path'); //=> true}
\DoxyCodeLine{}
\DoxyCodeLine{// When ./index.js exists}
\DoxyCodeLine{isResolvable('./index.js') //=> true}
\DoxyCodeLine{isResolvable('./index') //=> true}
\DoxyCodeLine{isResolvable('.') //=> true }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_is_resolvable_README_autotoc_md13214}{}\doxysection{Installation}\label{md_sfcode_node_modules_is_resolvable_README_autotoc_md13214}
\href{https://docs.npmjs.com/cli/install}{\texttt{ Use}} \href{https://docs.npmjs.com/getting-started/what-is-npm}{\texttt{ npm}}.


\begin{DoxyCode}{0}
\DoxyCodeLine{npm install is-\/resolvable }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_is_resolvable_README_autotoc_md13215}{}\doxysection{API}\label{md_sfcode_node_modules_is_resolvable_README_autotoc_md13215}

\begin{DoxyCode}{0}
\DoxyCodeLine{const isResolvable = require('is-\/resolvable'); }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_is_resolvable_README_autotoc_md13216}{}\doxysubsection{is\+Resolvable($<$em$>$module\+Id$<$/em$>$ \mbox{[}, $<$em$>$options$<$/em$>$\mbox{]})}\label{md_sfcode_node_modules_is_resolvable_README_autotoc_md13216}
{\itshape module\+Id}\+: {\ttfamily string} (module ID) ~\newline
 {\itshape options}\+: {\ttfamily Object} (\href{https://nodejs.org/api/modules.html\#modules_require_resolve_request_options}{\texttt{ {\ttfamily require.\+resolve}}} options) ~\newline
 Return\+: {\ttfamily boolean}

It returns {\ttfamily true} if {\ttfamily require()} can load a file form a given module ID, otherwise {\ttfamily false}.


\begin{DoxyCode}{0}
\DoxyCodeLine{const isResolvable = require('is-\/resolvable');}
\DoxyCodeLine{}
\DoxyCodeLine{// When ./foo.json exists}
\DoxyCodeLine{isResolvable('./foo.json'); //=> true}
\DoxyCodeLine{isResolvable('./foo'); //=> true}
\DoxyCodeLine{}
\DoxyCodeLine{isResolvable('./foo.js'); //=> false}
\DoxyCodeLine{}
\DoxyCodeLine{// When `eslint` module is installed but `jshint` isn't}
\DoxyCodeLine{isResolvable('eslint'); //=> true}
\DoxyCodeLine{isResolvable('jshint'); //=> false}
\DoxyCodeLine{}
\DoxyCodeLine{// When `lodash` module is installed}
\DoxyCodeLine{isResolvable('lodash/isObject'); //=> true}
\DoxyCodeLine{isResolvable('lodash/fp/reject.js'); //=> true }

\end{DoxyCode}


The second argument accepts an options object for {\ttfamily require.\+resolve()}.


\begin{DoxyCode}{0}
\DoxyCodeLine{// When ./bar/baz.js exists}
\DoxyCodeLine{}
\DoxyCodeLine{isResolvable('./baz.js'); //=> false}
\DoxyCodeLine{isResolvable('./baz.js', \{paths: ['bar']\}); //=> true }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_is_resolvable_README_autotoc_md13217}{}\doxysection{License}\label{md_sfcode_node_modules_is_resolvable_README_autotoc_md13217}
\href{./LICENSE}{\texttt{ ISC License}} © 2018 Shinnosuke Watanabe 