Skip to content

Reading-eScience-Centre/covjson-reader

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

covjson-reader

NPM version

A library that reads CoverageJSON documents and exposes them as Coverage data objects.

API docs

Usage

A browser version of this library is hosted on both jsDelivr and cdnjs.

Usage is simple:

<script src="https://cdn.jsdelivr.net/npm/covutils@0.6/covutils-lite.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/covjson-reader@0.16/covjson-reader.min.js"></script>
<script>
CovJSON.read('http://example.com/coverage.covjson').then(function (cov) {
  // work with Coverage object
}).catch(function (e) {
  // there was an error when loading the coverage
  console.log(e)
})
</script>

Note that this package has a dependency on the covutils package which must be loaded separately when using the browser bundle as shown above.

NPM

This library can be used with browserify and similar tools by importing it via npm.

ES2015 syntax:

import * as CovJSON from 'covjson-reader'

CovJSON.read('http://example.com/coverage.covjson').then(cov => {
  // work with Coverage object
}).catch(e => {
  // there was an error when loading the coverage
  console.log(e)
})

Acknowledgments

This library has been developed within the MELODIES project and is maintained as open source software.