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

covert

v1.1.1

Published

code coverage command con coverify

Downloads

1,608

Readme

covert

code coverage command

example

Just run covert on some ordinary files:

$ covert test/*.js
TAP version 13
# defined-or
ok 1 empty arguments
ok 2 1 undefined
ok 3 2 undefined
ok 4 4 undefineds
ok 5 false[0]
ok 6 false[1]
ok 7 zero[0]
ok 8 zero[1]
ok 9 first arg
ok 10 second arg
ok 11 third arg
# (anonymous)
ok 12 should be equal

1..12
# tests 12
# pass  12

# ok

# /home/substack/projects/defined/index.js: line 3, column 18-26

  if (false) dead();
             ^^^^^^^

# /home/substack/projects/defined/index.js: line 6, column 16-18, 19-25, 26-30, 31-51

  for (var i = 0; i < 5; i++) console.log('blah');
               ^  ^^^^^  ^^^  ^^^^^^^^^^^^^^^^^^^

# /home/substack/projects/defined/index.js: line 10, column 3-24

  console.log('blah');
  ^^^^^^^^^^^^^^^^^^^^

# coverage: 76/82 (92.68 %)

non-zero exit code in `coverify` command

In this example, this test suite is using tape. Tests written with tape can just be run directly using node, which fits very well with what this command expects.

install

With npm do:

npm install -g covert

usage

usage: covert {OPTIONS} FILES

  Instrument FILES and in-module dependencies, writing coverage data to STDERR.

  OPTIONS are:

    --json

      Suppress normal output and print json coverage data to stdout.

    -q, --quiet  

      Only print coverage data, suppressing all other output.

    -c, --color

      Use color in the output. Default: true if stdout is a TTY.

why

Most code coverage libraries do weird things I don't like, such as writing all their junk to directories and files in a completely out-of-band way.

covert:

  • only uses stderr and stdout, doesn't write to any files. All of this business about lcov files and directories with reports in them really weirds me out.

  • bundles with browserify --bare and a transform instead of hijacking require(). All the reporting goes through a unix pipeline on process.stdin and process.stdout. This is still hacky, but it's the kind of hacky that you can fix yourself when the magic breaks down. The internal pipeline is just:

browserify -t coverify --bare $* | node | coverify
  • works really well with simple unix pipelines. stdin and stdout: the wisdom of the ancients.

license

MIT