Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 8, 2024 via pnpm

istanbul-lib-coverage 3.2.0

Data library for istanbul coverage objects
Package summary
Share
0
issues
1
license
1
BSD-3-Clause
Package created
21 Nov 2015
Version published
18 Oct 2021
Maintainers
4
Total deps
1
Direct deps
0
License
BSD-3-Clause

Issues

0
This package has no issues

Licenses

BSD 3-Clause "New" or "Revised" License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
place-warranty
Cannot
use-trademark
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
istanbul-lib-coverage@3.2.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of istanbul-lib-coverage 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does istanbul-lib-coverage do?

Istanbul-lib-coverage is a Node.js package that provides a potent API for inspecting, merging, and summarizing coverage information in JavaScript. It is predominantly used for inspecting test coverage in the software testing field.

How do you use istanbul-lib-coverage?

To utilize istanbul-lib-coverage, follow these steps:

  1. Install the package with npm using the command: npm i istanbul-lib-coverage.
  2. After the installation, use require to import it into your file, as shown below:
var libCoverage = require('istanbul-lib-coverage');
  1. With the imported API, you can start crafting coverage maps and summaries, merge them, and inspect file coverages for any given file. Here is an illustrative use case:
var libCoverage = require('istanbul-lib-coverage');
var map = libCoverage.createCoverageMap(globalCoverageVar);
var summary = libCoverage.createCoverageSummary();

// merge another coverage map into the one we created
map.merge(otherCoverageMap);

// inspect and summarize all file coverage objects in the map
map.files().forEach(function(f) {
    var fc = map.fileCoverageFor(f),
        s = fc.toSummary();
    summary.merge(s);
});

console.log('Global summary', summary);

Here, we generate a coverage map using the createCoverageMap function, from a global coverage variable. Then we create a coverage summary using createCoverageSummary. The created map gets merged with another one using map.merge function. We then loop through all file coverage objects in the map, extract summaries, and merge them into the original summary. Finally, we print the global summary to console.

Where are the istanbul-lib-coverage docs?

The official istanbul-lib-coverage documentation can be found on the GitHub repository: istanbul-lib-coverage. Here, you can dig deep into the library's functionality, view complete API details, and up-to-date version information.