lcov-parse
Parse lcov results files and return JSON
Last updated 7 years ago by davglass .
BSD-3-Clause · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install lcov-parse 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.0.0                                ...           latest (7 years ago)

11 Versions

  • 1.0.0                                ...           7 years ago
  • 0.0.10                                ...           9 years ago
  • 0.0.9                                ...           10 years ago
  • 0.0.8                                ...           10 years ago
  • 0.0.7                                ...           10 years ago
  • 0.0.6                                ...           11 years ago
  • 0.0.5                                ...           11 years ago
  • 0.0.4                                ...           12 years ago
  • 0.0.3                                ...           12 years ago
  • 0.0.2                                ...           12 years ago
  • 0.0.1                                ...           12 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (4)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |