\href{https://github.com/JS-DevTools/coverage-istanbul-loader/actions}{\texttt{ }} \href{https://github.com/JS-DevTools/coverage-istanbul-loader/actions}{\texttt{ }}

\href{https://coveralls.io/github/JS-DevTools/coverage-istanbul-loader?branch=master}{\texttt{ }} \href{https://david-dm.org/JS-DevTools/coverage-istanbul-loader}{\texttt{ }}

\href{https://www.npmjs.com/package/@jsdevtools/coverage-istanbul-loader}{\texttt{ }} \mbox{[}\mbox{]}(LICENSE) \href{https://plant.treeware.earth/JS-DevTools/coverage-istanbul-loader}{\texttt{ }}

This is a \href{https://webpack.js.org/loaders/}{\texttt{ Webpack loader}} that uses \href{https://istanbul.js.org/}{\texttt{ Istanbul}} to add code coverage instrumentation to your code. This is especially useful for in-\/browser testing, in a tool like \href{https://karma-runner.github.io/3.0/index.html}{\texttt{ Karma}}, where you can use \href{https://github.com/mattlewis92/karma-coverage-istanbul-reporter}{\texttt{ karma-\/coverage-\/istanbul-\/reporter}} to output code coverage data in a variety of formats that are supported by services like \href{https://coveralls.io/}{\texttt{ Coveralls}} or \href{https://www.codacy.com/}{\texttt{ Codacy}}.

Coverage Istanbul Loader is based on \href{https://github.com/webpack-contrib/istanbul-instrumenter-loader}{\texttt{ Istanbul Instrumenter Loader}}, but uses a newer version of the \href{https://github.com/istanbuljs/istanbuljs/tree/master/packages/istanbul-lib-instrument}{\texttt{ Istanbul API}} and has better support for source maps.\hypertarget{md_sfcode_node_modules__jsdevtools_coverage_istanbul_loader_README_autotoc_md1910}{}\doxysection{Usage}\label{md_sfcode_node_modules__jsdevtools_coverage_istanbul_loader_README_autotoc_md1910}
See \mbox{[}the examples folder\mbox{]}(examples) for usage examples for various use cases.


\begin{DoxyItemize}
\item {\bfseries{\href{examples/hello-world}{\texttt{ \char`\"{}hello, world\char`\"{} example}}}}~\newline
 This is the most simplistic example. It just uses coverage-\/istanbul-\/loader with its default options to produce an output bundle that contains code coverage instrumentation.
\item {\bfseries{\href{examples/typescript}{\texttt{ Type\+Script example}}}}~\newline
 This example demonstrates using coverage-\/istanbul-\/loader with transpiled code. It correctly maps the instrumented Java\+Script code back to the original Type\+Script source code.
\item {\bfseries{\href{examples/karma}{\texttt{ Karma example}}}}~\newline
 This example demonstrates using coverage-\/istanbul-\/loader with \href{https://karma-runner.github.io/3.0/index.html}{\texttt{ Karma}} and \href{https://github.com/mattlewis92/karma-coverage-istanbul-reporter}{\texttt{ karma-\/coverage-\/istanbul-\/reporter}} to produce code coverage reports for browser tests.
\item {\bfseries{\href{examples/options}{\texttt{ Example with options}}}}~\newline
 This example demonstrates passing options to coverage-\/istanbul-\/loader. The options are passed-\/on to \href{https://github.com/istanbuljs/istanbuljs/tree/master/packages/istanbul-lib-instrument}{\texttt{ istanbul-\/lib-\/instrument}}, so \href{https://github.com/istanbuljs/istanbuljs/blob/25509c7ff31f114e7036a940ed799d6d0548b706/packages/istanbul-lib-instrument/src/instrumenter.js\#L11-L33}{\texttt{ all the same options}} are supported.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules__jsdevtools_coverage_istanbul_loader_README_autotoc_md1911}{}\doxysection{Contributing}\label{md_sfcode_node_modules__jsdevtools_coverage_istanbul_loader_README_autotoc_md1911}
Contributions, enhancements, and bug-\/fixes are welcome! \href{https://github.com/JS-DevTools/coverage-istanbul-loader/issues}{\texttt{ Open an issue}} on Git\+Hub and \href{https://github.com/JS-DevTools/coverage-istanbul-loader/pulls}{\texttt{ submit a pull request}}.\hypertarget{md_sfcode_node_modules__jsdevtools_coverage_istanbul_loader_README_autotoc_md1912}{}\doxysubsubsection{Building/\+Testing}\label{md_sfcode_node_modules__jsdevtools_coverage_istanbul_loader_README_autotoc_md1912}
To build/test the project locally on your computer\+:


\begin{DoxyEnumerate}
\item {\bfseries{Clone this repo}}~\newline
 {\ttfamily git clone \href{https://github.com/JS-DevTools/coverage-istanbul-loader.git}{\texttt{ https\+://github.\+com/\+JS-\/\+Dev\+Tools/coverage-\/istanbul-\/loader.\+git}}}
\item {\bfseries{Install dependencies}}~\newline
 {\ttfamily npm install}
\item {\bfseries{Build the code}}~\newline
 {\ttfamily npm run build}
\item {\bfseries{Run the tests}}~\newline
 {\ttfamily npm test}
\end{DoxyEnumerate}\hypertarget{md_sfcode_node_modules__jsdevtools_coverage_istanbul_loader_README_autotoc_md1913}{}\doxysection{License}\label{md_sfcode_node_modules__jsdevtools_coverage_istanbul_loader_README_autotoc_md1913}
coverage-\/istanbul-\/loader is 100\% free and open-\/source, under the \mbox{[}MIT license\mbox{]}(LICENSE). Use it however you want.

This package is \href{http://treeware.earth}{\texttt{ Treeware}}. If you use it in production, then we ask that you \href{https://plant.treeware.earth/JS-DevTools/coverage-istanbul-loader}{\texttt{ {\bfseries{buy the world a tree}}}} to thank us for our work. By contributing to the Treeware forest you’ll be creating employment for local families and restoring wildlife habitats.\hypertarget{md_sfcode_node_modules__jsdevtools_coverage_istanbul_loader_README_autotoc_md1914}{}\doxysection{Big Thanks To}\label{md_sfcode_node_modules__jsdevtools_coverage_istanbul_loader_README_autotoc_md1914}
Thanks to these awesome companies for their support of Open Source developers ❤

\href{https://travis-ci.com}{\texttt{ }} \href{https://saucelabs.com}{\texttt{ }} \href{https://coveralls.io}{\texttt{ }} 