npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@stackline/karma-coverage

v1.0.2

Published

A Karma plugin. Generate code coverage.

Readme

@stackline/karma-coverage

A Karma plugin. Generate code coverage.

npm version license GitHub repository Docs Reddit community

Documentation | npm | Issues | Repository

Current package version: 1.0.2


Why this package?

@stackline/karma-coverage is the Stackline-maintained distribution of [email protected]. It is an independent continuation of karma-coverage; original authors and licenses remain credited below.

Compatibility

| Item | Value | | :--- | :--- | | Package | @stackline/[email protected] | | API target | [email protected] | | Supported Node.js | >=10.0.0 | | License | MIT | | Main entry | lib/index.js | | Runtime dependencies | istanbul-lib-coverage, istanbul-lib-instrument, istanbul-lib-report, istanbul-lib-source-maps, istanbul-reports, minimatch |

Installation

npm install @stackline/karma-coverage

Preserve existing imports and plugin resolution with an npm alias:

npm install karma-coverage@npm:@stackline/karma-coverage

Usage and API reference

karma-coverage

Generate code coverage using Istanbul.

Installation

The easiest way is to install karma-coverage as a devDependency, by running

npm install karma karma-coverage --save-dev

Configuration

For configuration details see docs/configuration.

Examples

Basic

// karma.conf.js
module.exports = function(config) {
  config.set({
    files: [
      'src/**/*.js',
      'test/**/*.js'
    ],

    // coverage reporter generates the coverage
    reporters: ['progress', 'coverage'],

    preprocessors: {
      // source files, that you wanna generate coverage for
      // do not include tests or libraries
      // (these files will be instrumented by Istanbul)
      'src/**/*.js': ['coverage']
    },

    // optionally, configure the reporter
    coverageReporter: {
      type : 'html',
      dir : 'coverage/'
    }
  });
};

CoffeeScript

For an example on how to use with CoffeeScript see examples/coffee. For an example of how to use with CoffeeScript and the RequireJS module loader, see examples/coffee-requirejs (and also see the useJSExtensionForCoffeeScript option in docs/configuration.md).

Advanced, multiple reporters

// karma.conf.js
module.exports = function(config) {
  config.set({
    files: [
      'src/**/*.js',
      'test/**/*.js'
    ],
    reporters: ['progress', 'coverage'],
    preprocessors: {
      'src/**/*.js': ['coverage']
    },
    coverageReporter: {
      // specify a common output directory
      dir: 'build/reports/coverage',
      reporters: [
        // reporters not supporting the `file` property
        { type: 'html', subdir: 'report-html' },
        { type: 'lcov', subdir: 'report-lcov' },
        // reporters supporting the `file` property, use `subdir` to directly
        // output them in the `dir` directory
        { type: 'cobertura', subdir: '.', file: 'cobertura.txt' },
        { type: 'lcovonly', subdir: '.', file: 'report-lcovonly.txt' },
        { type: 'teamcity', subdir: '.', file: 'teamcity.txt' },
        { type: 'text', subdir: '.', file: 'text.txt' },
        { type: 'text-summary', subdir: '.', file: 'text-summary.txt' },
      ]
    }
  });
};

FAQ

Don't minify instrumenter output

When using the istanbul instrumenter (default), you can disable code compaction by adding the following to your configuration.

// karma.conf.js
module.exports = function(config) {
  config.set({
    coverageReporter: {
      instrumenterOptions: {
        istanbul: { noCompact: true }
      }
    }
  });
};

For more information on Karma see the homepage.

Credits and original authors

  • Original project: karma-coverage.
  • SATO taichi.
  • dignifiedquire.
  • Friedel Ziegelmayer.
  • Aymeric Beaumet.
  • Anton.
  • johnjbarton.
  • dependabot[bot].
  • Jonathan Ginsburg.
  • Mark Ethan Trostler.
  • Tim Kang.
  • hicom150.
  • semantic-release-bot.
  • Anton Shchekota.
  • Maksim Ryzhikov.
  • Nick Malaguti.
  • Mark Trostler.
  • nicojs.
  • Allen Bierbaum.
  • Douglas Duteil.
  • Julen Garcia Leunda.
  • Matt Winchester.
  • Srinivas Dhanwada.
  • Tanguy Krotoff.
  • Wei Kin Huang.
  • Yaroslav Admin.
  • Adam Heath.
  • Andrew Lane.
  • Chris Gladd.
  • Clayton Watts.
  • Dan Watling.
  • Darryl Pogue.
  • Diogo Nicoleti.
  • Dmitry Petrov.
  • Francesco Borzì.
  • Greg Varsanyi.
  • Ian Rufus.
  • James Talmage.
  • Joseph Connolly.
  • Joshua Appelman.
  • Julie.
  • Kyle Welsby.
  • Lloyd Smith II.
  • Maciej Rzepiński.
  • Marceli.no.
  • Matt Lewis.
  • Michael Noack.
  • Michael Stramel.
  • Nick Matantsev.
  • Petar Manev.
  • Robin Böhm.
  • Ron Derksen.
  • Ruben Bridgewater.
  • Sahat Yalkabov.
  • Tanjo, Hiroyuki.
  • Taylor Hakes.
  • Taylor McGann.
  • Tim van der Lippe.
  • Timo Tijhof.
  • Tom Kirkpatrick.
  • Tyler Waters.
  • Vincent Lemeunier.
  • Yusuke Suzuki.
  • abbr.
  • aprooks.
  • carlos.
  • fbergr.
  • piecyk.
  • terussell85.
  • Copyright (C) 2011-2013 Google, Inc.
  • Stackline maintenance: Alexandro Paixao Marques and Stackline contributors.

Original copyright, license notices and contributor acknowledgements remain part of this distribution. Stackline maintenance does not replace authorship of the original work.

License

MIT. See the license and notice files in the repository.

Community and Links

Use this repository's issue tracker for reproducible bugs and feature requests. Join r/Stackline for examples, usage questions and release discussions.