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

apb-mocha-reporter

v1.0.7

Published

A simple dashboard to report mocha test runs.

Readme

APB Mocha Reporter

Description

A zero-dependency tool that displays your unit test results in a nifty HTML page.

  • Show live test results in your office / HQ
  • HTML dashboard Auto refreshes every minute
  • Output detailed test results to JSON

Note: This package requires the Node fs module. It does not work in the browser.

Screenshot

Installation

Obviously, you need an existing mocha test suite

  1. NPM: npm install apb-mocha-reporter --save-dev
  2. Update your test script: mocha ./**.test.js --reporter apb-mocha-reporter

Usage

This reporter replaces the default Mocha console output with a more minimal console output.

The html dashboard is generated each time you run Mocha and is written to:

/yourProject/apb-mocha-reporter-report/apb-mocha-reporter.html

Just open up the html file in a browser, and it will auto-refresh every 60 seconds.

Prevent console output

Pass the silent reporter option to prevent the runner from printing to the console.

mocha ./**.test.js --reporter apb-mocha-reporter --reporter-options silent"

Save detailed test results as JSON

Pass the savejson reporter option to save a detailed report as JSON.

EG:

mocha ./**.test.js --reporter apb-mocha-reporter --reporter-options savejson"

An optional filename may be passed. Otherwise, the output will be in:

yourProject/apb-mocha-reporter-report/apb-mocha-reporter-YYYYMMDD-HHMMSS.json

You may want to pass a file name to prevent logs from building up.

EG:

mocha ./**.test.js --reporter apb-mocha-reporter --reporter-options savejson=filename.json"

Change output directory

Pass the outputdir reporter option with a value to change the output directory.

mocha ./**.test.js --reporter apb-mocha-reporter --reporter-options outputdir='customOutputDir'

Multiple options

To pass multiple options, for example, to be both silent and to save json, reporter-options should be in a comma separated list without spaces.

EG:

mocha ./**.test.js --reporter apb-mocha-reporter --reporter-options silent,savejson=filename.json"

Modifying the template

If you want to fiddle around with the template, you will find apbmochareporter_TEMPLATE.html in the src directory of this package. The output html dashboard is generated using this template.

I didn't want to bloat the package by adding unnecessary templating dependencies, so it currently uses a potentially fragile (but lightweight!) regex based solution that replaces the strings surrounded by double curly braces (eg. {{string}}).

Contributing

PRs welcome.

Have a look at the github issue tracker for suggested updates.