\href{https://npmjs.org/package/compressible}{\texttt{ }} \href{https://npmjs.org/package/compressible}{\texttt{ }} \href{https://nodejs.org/en/download}{\texttt{ }} \href{https://travis-ci.org/jshttp/compressible}{\texttt{ }} \href{https://coveralls.io/r/jshttp/compressible?branch=master}{\texttt{ }}

Compressible {\ttfamily Content-\/\+Type} / {\ttfamily mime} checking.\hypertarget{md_sfcode_node_modules_compressible_README_autotoc_md6002}{}\doxysection{Installation}\label{md_sfcode_node_modules_compressible_README_autotoc_md6002}

\begin{DoxyCode}{0}
\DoxyCodeLine{\$ npm install compressible }

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

\begin{DoxyCode}{0}
\DoxyCodeLine{var compressible = require('compressible') }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_compressible_README_autotoc_md6004}{}\doxysubsection{compressible(type)}\label{md_sfcode_node_modules_compressible_README_autotoc_md6004}
Checks if the given {\ttfamily Content-\/\+Type} is compressible. The {\ttfamily type} argument is expected to be a value MIME type or {\ttfamily Content-\/\+Type} string, though no validation is performed.

The MIME is looked up in the \href{https://www.npmjs.com/package/mime-db}{\texttt{ {\ttfamily mime-\/db}}} and if there is compressible information in the database entry, that is returned. Otherwise, this module will fallback to {\ttfamily true} for the following types\+:


\begin{DoxyItemize}
\item {\ttfamily text/$\ast$}
\item {\ttfamily $\ast$/$\ast$+json}
\item {\ttfamily $\ast$/$\ast$+text}
\item {\ttfamily $\ast$/$\ast$+xml}
\end{DoxyItemize}

If this module is not sure if a type is specifically compressible or specifically uncompressible, {\ttfamily undefined} is returned.


\begin{DoxyCode}{0}
\DoxyCodeLine{compressible('text/html') // => true}
\DoxyCodeLine{compressible('image/png') // => false }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_compressible_README_autotoc_md6005}{}\doxysection{License}\label{md_sfcode_node_modules_compressible_README_autotoc_md6005}
\mbox{[}MIT\mbox{]}(LICENSE) 