# lcov-parse

> Parse lcov results files and return JSON

Latest version **1.0.0** (published 2017-06-12) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install lcov-parse
pnpm add lcov-parse
yarn add lcov-parse
bun add lcov-parse
```

Provides the command `lcov-parse`.

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2017-06-12 |
| First published | 2012-07-10 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | separate (@types/lcov-parse) |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 55 |
| Author | Dav Glass |
| Maintainers | davglass |

## Links

- npm: https://www.npmjs.com/package/lcov-parse
- Repository: https://github.com/davglass/lcov-parse
- Homepage: https://github.com/davglass/lcov-parse#readme
- Issues: http://github.com/davglass/lcov-parse/issues
- npm.io page: https://npm.io/package/lcov-parse

## Recent versions

- 1.0.0 (latest) — 2017-06-12
- 0.0.10 — 2015-06-03
- 0.0.9 — 2015-01-30
- 0.0.8 — 2014-06-17
- 0.0.7 — 2014-05-23
- 0.0.6 — 2014-01-20
- 0.0.5 — 2013-07-15
- 0.0.4 — 2013-04-07
- 0.0.3 — 2013-03-28
- 0.0.2 — 2013-01-15
- 0.0.1 — 2012-07-10

## README

## LCOV file parser

Simple LCOV file parser

## Installation

    npm install lcov-parse


## Usage

    var parse = require('lcov-parse');

    parse('./path/to/file.info', function(err, data) {
        //process the data here
    });

or

    parse(lcovString, function(err, data) {
        //process the data here
    });


## Formatting

Using this as a guide: http://ltp.sourceforge.net/coverage/lcov/geninfo.1.php

It will return JSON like this:

```
 {
    "title": "Test #1",
    "file": "anim-base/anim-base-coverage.js",
    "functions": {
      "hit": 23,
      "found": 29,
      "details": [
        {
          "name": "(anonymous 1)",
          "line": 7,
          "hit": 6
        },
        {
          "name": "(anonymous 2)",
          "line": 620,
          "hit": 225
        },
        {
          "name": "_end",
          "line": 516,
          "hit": 228
        }
      ]
    }
    "lines": {
      "found": 181,
      "hit": 143,
      "details": [
        {
          "line": 7,
          "hit": 6
        },
        {
          "line": 29,
          "hit": 6
        }
      ]
    }
}
```


## Cli Usage

    lcov-parse ./lcov.info

or

    cat lcov.info | xargs -0 lcov-parse
   
   
## Tests

    npm install && npm test


## Build Status

[![Build Status](https://secure.travis-ci.org/davglass/lcov-parse.png?branch=master)](http://travis-ci.org/davglass/lcov-parse)

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