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 🙏

© 2024 – Pkg Stats / Ryan Hefner

coveradge

v0.8.2

Published

Generate coverage badges during local nyc/istanbul execution

Downloads

427

Readme

npm Dependencies devDependencies

testing badge coverage badge

Known Vulnerabilities Total Alerts Code Quality: Javascript

Licenses badge

(see also licenses for dev. deps.)

issuehunt-to-marktext

coveradge

Installation

If you need png export, run:

npm i -D coveradge convert-svg-to-png

Otherwise, just this:

npm i -D coveradge

Usage

  1. Ensure you have at least the following reporter in your package.json:
{
  "nyc": {
    "reporter": [
      "json-summary"
    ]
  }
}

You may optionally set coverage thresholds and/or watermarks:

{
  "nyc": {
    "reporter": [
      "json-summary"
    ],
    "branches": 80,
    "lines": 80,
    "functions": 80,
    "statements": 80,
    "watermarks": {
      "lines": [80, 95],
      "functions": [80, 95],
      "branches": [80, 95],
      "statements": [80, 95]
    }
  }
}

The watermarks, if present, will be given precedence over the regular thresholds for determining color (though not as high of a precedence as command-line thresholds).

  1. Add --reporter coveradge at the beginning of the nyc call. Alternatively, e.g., if you need to build a coveradge badge after testing has already finished for a merged coverage file, add a call to coveradge in your package.json scripts at some point after running nyc.

  2. Add any desired options. If using as an nyc --reporter, then add the options to package.json instead of a coveradgeOptions property. Otherwise, pass as CLI or programmatic options. (See below for the choices.)

  3. Add the badge to your README (e.g., [![coverage badge](coverage-badge.svg)](coverage-badge.svg)) or for a link that will also work on npmjs.com: [![coverage badge](https://raw.githubusercontent.com/brettz9/coveradge/master/coverage-badge.svg?sanitize=true)](coverage-badge.svg)

That's it!

Options

CLI instructions

See also

  • eslint-formatter-badger - Locally created badges indicating linting results (as run against your project and/or your dependencies)
  • filesize-badger - Locally created badges indicating file size (also buildable as part of Rollup routine)
  • mocha-badge-generator - Locally created badges for Mocha test results
  • license-badger - Locally-created badges indicating license types (by degree of permissiveness) used within or required by the project.