@cvrg-report/golang-cover-json
v0.1.2
Published
Parse golang cover coverage data to JSON, using the same format as lcov-parse
Downloads
1
Maintainers
Readme
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!