# istanbul-lib-instrument

> Core istanbul API for JS code coverage

Latest version **6.0.3** (published 2024-06-30) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install istanbul-lib-instrument
pnpm add istanbul-lib-instrument
yarn add istanbul-lib-instrument
bun add istanbul-lib-instrument
```

## Health

**Score 33/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 6.0.3 |
| Published | 2024-06-30 |
| First published | 2015-11-21 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | separate (@types/istanbul-lib-instrument) |
| Module format | CommonJS |
| Node | >=10 |
| Dependencies | 5 |
| Unpacked size | 70.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1103 |
| Author | Krishnan Anantheswaran |
| Keywords | coverage, istanbul, js, instrumentation |

## Links

- npm: https://www.npmjs.com/package/istanbul-lib-instrument
- Repository: https://github.com/istanbuljs/istanbuljs
- Homepage: https://istanbul.js.org/
- Issues: https://github.com/istanbuljs/istanbuljs/issues
- npm.io page: https://npm.io/package/istanbul-lib-instrument

## Dependencies (5)

- [semver](https://npm.io/package/semver.md) ^7.5.4
- [@babel/core](https://npm.io/package/@babel/core.md) ^7.23.9
- [@babel/parser](https://npm.io/package/@babel/parser.md) ^7.23.9
- [@istanbuljs/schema](https://npm.io/package/@istanbuljs/schema.md) ^0.1.3
- [istanbul-lib-coverage](https://npm.io/package/istanbul-lib-coverage.md) ^3.2.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 6.0.3 (latest) — 2024-06-30
- 6.0.2 — 2024-02-19
- 6.0.1 — 2023-10-04
- 6.0.0 — 2023-07-25
- 5.2.1 — 2022-10-05
- 5.2.0 — 2022-04-20
- 5.1.0 — 2021-10-27
- 5.0.4 — 2021-10-16
- 5.0.3 — 2021-10-06
- 5.0.2 — 2021-09-13
- 4.0.3 — 2020-05-09
- 4.0.2 — 2020-05-06
- 4.0.1 — 2020-02-03
- 4.0.0 — 2019-12-20
- 4.0.0-alpha.3 — 2019-12-07
- … 60 more at https://npm.io/package/istanbul-lib-instrument/versions

## README

## istanbul-lib-instrument

[![Build Status](https://travis-ci.org/istanbuljs/istanbul-lib-instrument.svg?branch=main)](https://travis-ci.org/istanbuljs/istanbul-lib-instrument)

Istanbul instrumenter library.

Version 1.1.x now implements instrumentation using `Babel`. The implementation is inspired
by prior art by @dtinth as demonstrated in the `__coverage__` babel plugin.

It provides 2 "modes" of instrumentation.

-   The old API that is mostly unchanged (except for incompatibilities noted) and
    performs the instrumentation using babel as a library.

-   A `programVisitor` function for the Babel AST that can be used by a Babel plugin
    to emit instrumentation for ES6 code directly without any source map
    processing. This is the preferred path for babel users. The Babel plugin is
    called `babel-plugin-istanbul`.

Incompatibilities and changes to instrumentation behavior can be found in
[v0-changes.md](v0-changes.md).

---
_Source: https://npm.io/package/istanbul-lib-instrument · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
