@cvrg-report/golang-cover-json

Parse golang cover coverage data to JSON, using the same format as lcov-parse


Keywords
coverage, report, golang, cover, json, lcov, parse
License
MIT
Install
npm install @cvrg-report/golang-cover-json@0.1.2

Documentation

golang-cover-json

Parse golang-cover report files, and return a JSON representation in a lcov-parse compatible manner.

Installation

$ npm i @cvrg-report/golang-cover-json --save

Usage

var gocov = require("@cvrg-report/golang-cover-json");

// Parse by file path
gocov.parseFile("filepath.xml")
    .then(function (result) {
        console.log(JSON.stringify(result));
    }).catch(function (err) {
        console.error(err);
    });

// Parse by file contents
gocov.parseContent("mode: count ...")
    .then(function (result) {
        console.log(JSON.stringify(result));
    }).catch(function (err) {
        console.error(err);
    });

Thanks

This repo was initially forked from vokal/golang-cover-parse. Thanks a lot!