Node 8\textquotesingle{}s \href{https://nodejs.org/api/util.html\#util_util_promisify_original}{\texttt{ `require(\textquotesingle{}util').promisify\`{}}} as a node module, so you can use it right now!

Supports \href{https://github.com/nodejs/LTS\#lts-schedule1}{\texttt{ all major node versions}}.

\href{http://travis-ci.org/juliangruber/util-promisify}{\texttt{ }} \href{https://www.npmjs.org/package/util-promisify}{\texttt{ }} \href{https://greenkeeper.io/}{\texttt{ }}\hypertarget{md_sfcode_node_modules_util_promisify_README_autotoc_md31645}{}\doxysection{Usage}\label{md_sfcode_node_modules_util_promisify_README_autotoc_md31645}

\begin{DoxyCode}{0}
\DoxyCodeLine{const promisify = require('util-\/promisify');}
\DoxyCodeLine{const fs = require('fs');}
\DoxyCodeLine{}
\DoxyCodeLine{const stat = promisify(fs.stat);}
\DoxyCodeLine{}
\DoxyCodeLine{stat('/tmp/').then(s => \{}
\DoxyCodeLine{  // ...}
\DoxyCodeLine{\}); }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_util_promisify_README_autotoc_md31646}{}\doxysection{Installation}\label{md_sfcode_node_modules_util_promisify_README_autotoc_md31646}

\begin{DoxyCode}{0}
\DoxyCodeLine{\$ npm install util-\/promisify }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_util_promisify_README_autotoc_md31647}{}\doxysection{API}\label{md_sfcode_node_modules_util_promisify_README_autotoc_md31647}
See {\ttfamily util.\+promisify}\textquotesingle{}s \href{https://nodejs.org/api/util.html\#util_util_promisify_original}{\texttt{ API docs}}.\hypertarget{md_sfcode_node_modules_util_promisify_README_autotoc_md31648}{}\doxysubsection{promisify(original)}\label{md_sfcode_node_modules_util_promisify_README_autotoc_md31648}
\hypertarget{md_sfcode_node_modules_util_promisify_README_autotoc_md31649}{}\doxysubsection{(\+Symbol) promisify.\+custom}\label{md_sfcode_node_modules_util_promisify_README_autotoc_md31649}
If available, the Symbol is reexported from node core\textquotesingle{}s {\ttfamily util} module.\hypertarget{md_sfcode_node_modules_util_promisify_README_autotoc_md31650}{}\doxysection{License}\label{md_sfcode_node_modules_util_promisify_README_autotoc_md31650}
MIT

Polyfill for util.\+promisify in node versions $<$ v8

node v8.\+0.\+0 added support for a built-\/in {\ttfamily util.\+promisify}\+: \href{https://github.com/nodejs/node/pull/12442/}{\texttt{ https\+://github.\+com/nodejs/node/pull/12442/}}

This package provides the built-\/in {\ttfamily util.\+promisify} in node v8.\+0.\+0 and later, and a replacement in other environments.\hypertarget{md_sfcode_node_modules_util_promisify_README_autotoc_md31709}{}\doxysection{Usage}\label{md_sfcode_node_modules_util_promisify_README_autotoc_md31709}
{\bfseries{Direct}} 
\begin{DoxyCode}{0}
\DoxyCodeLine{const promisify = require('util.promisify');}
\DoxyCodeLine{// Use `promisify` just like the built-\/in method on `util` }

\end{DoxyCode}


{\bfseries{Shim}} 
\begin{DoxyCode}{0}
\DoxyCodeLine{require('util.promisify/shim')();}
\DoxyCodeLine{// `util.promisify` is now defined}
\DoxyCodeLine{const util = require('util');}
\DoxyCodeLine{// Use `util.promisify` }

\end{DoxyCode}


Note\+: this package requires a native ES5 environment, and for {\ttfamily Promise} to be globally available. It will throw upon requiring it if these are not present.\hypertarget{md_sfcode_node_modules_util_promisify_README_autotoc_md31710}{}\doxysection{Promisifying modules}\label{md_sfcode_node_modules_util_promisify_README_autotoc_md31710}
If you want to promisify a whole module, like the {\ttfamily fs} module, you can use \href{https://www.npmjs.com/package/util.promisify-all}{\texttt{ {\ttfamily util.\+promisify-\/all}}}. 