@cvrg-report/cobertura-json
v0.1.3
Published
Parse cobertura coverage to JSON, using the same format as lcov-parse
Downloads
24
Readme
cobertura-json
Parse cobertura report files, and return a JSON representation in a lcov-parse compatible manner.
Installation
npm install @cvrg-report/cobertura-json --save
Usage
var cobertura = require( "@cvrg-report/cobertura-json" );
// Parse by file path
cobertura.parseFile("filepath.xml")
.then(function (result) {
console.log(JSON.stringify(result));
}).catch(function (err) {
console.error(err);
});
// Parse by file contents
cobertura.parseContent("<?xml version=\"1.0\" ?><coverage>...</coverage>")
.then(function (result) {
console.log(JSON.stringify(result));
}).catch(function (err) {
console.error(err);
});
Thanks
This repo was initially forked from vokal/cobertura-parse. Thanks a lot!