UNPKG

948 BMarkdownView Raw
1## istanbul-lib-instrument
2
3[![Build Status](https://travis-ci.org/istanbuljs/istanbul-lib-instrument.svg?branch=master)](https://travis-ci.org/istanbuljs/istanbul-lib-instrument)
4
5Istanbul instrumenter library.
6
7Version 1.1.x now implements instrumentation using `Babel`. The implementation is inspired
8by prior art by @dtinth as demonstrated in the `__coverage__` babel plugin.
9
10It provides 2 "modes" of instrumentation.
11
12- The old API that is mostly unchanged (except for incompatibilities noted) and
13 performs the instrumentation using babel as a library.
14
15- A `programVisitor` function for the Babel AST that can be used by a Babel plugin
16 to emit instrumentation for ES6 code directly without any source map
17 processing. This is the preferred path for babel users. The Babel plugin is
18 called `babel-plugin-istanbul`.
19
20Incompatibilities and changes to instrumentation behavior can be found in
21[v0-changes.md](v0-changes.md).
22