Socket
Socket
Sign inDemoInstall

istanbul-reports

Package Overview
Dependencies
9
Maintainers
5
Versions
57
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    istanbul-reports

istanbul reports


Version published
Weekly downloads
22M
decreased by-19.24%
Maintainers
5
Install size
450 kB
Created
Weekly downloads
 

Package description

What is istanbul-reports?

The istanbul-reports npm package is used for generating coverage reports in various formats from Istanbul coverage JSON objects. Istanbul is a JavaScript code coverage tool that computes statement, line, function, and branch coverage with module loader hooks to work seamlessly with the code. The reports generated by istanbul-reports can be in HTML, text, text-summary, lcov, and more, which are useful for visualizing and understanding the code coverage of a project.

What are istanbul-reports's main functionalities?

HTML Report Generation

Generates a detailed HTML report that visualizes code coverage with syntax highlighting, directory views, and file views.

const reports = require('istanbul-reports');
const libReport = require('istanbul-lib-report');

// Assuming you have a coverageMap object
const context = libReport.createContext({
  dir: 'coverage', // output directory
  coverageMap: coverageMap
});

const report = reports.create('html', {
  // any options here
});

report.execute(context);

Text Report Generation

Produces a simple text report that summarizes the coverage metrics, which can be output to the console or a file.

const reports = require('istanbul-reports');
const libReport = require('istanbul-lib-report');

// Assuming you have a coverageMap object
const context = libReport.createContext({
  dir: 'coverage', // output directory
  coverageMap: coverageMap
});

const report = reports.create('text');

report.execute(context);

LCOV Report Generation

Creates an lcov report that is compatible with tools that accept the lcov format, such as coveralls.io.

const reports = require('istanbul-reports');
const libReport = require('istanbul-lib-report');

// Assuming you have a coverageMap object
const context = libReport.createContext({
  dir: 'coverage', // output directory
  coverageMap: coverageMap
});

const report = reports.create('lcovonly');

report.execute(context);

Other packages similar to istanbul-reports

Readme

Source

istanbul-reports

Greenkeeper badge Build Status

  • node.getRelativeName

  • context.getSource(filePath)

  • context.classForPercent(type, percent)

  • context.console.colorize(str, class)

  • context.writer

  • context.console.write

  • context.console.println

Keywords

FAQs

Last updated on 13 Jul 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc