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

dush-tap-report

v1.0.0

Published

A simple TAP report producer based on event system. A plugin for `dush` event emitter or anything based on it

Downloads

7

Readme

dush-tap-report NPM version mit license NPM monthly downloads npm total downloads

A simple TAP report producer based on event system. A plugin for dush event emitter or anything based on it

code climate code style linux build windows build code coverage dependency status paypal donate

You might also be interested in dush - an event emitter system, extensible through plugins. Or minibase, a tiny framework based on dush for building robust and complex applications.

Table of Contents

(TOC generated by verb using markdown-toc)

Install

Install with npm

$ npm install dush-tap-report --save

or install using yarn

$ yarn add dush-tap-report

Usage

For more use-cases see the tests

const dushTapReport = require('dush-tap-report')

API

tapReport

A simple TAP report producing plugin for dush or anything based on it. It returns a function that can be passed to dush's .use method. This plugin will also work for minibase and base mini frameworks for building robust apps.

Params

  • options {Object}: optional options, merged with app.options, passed to stacktrace-metadata and find-callsite
  • options.writeLine {Function}: a logger function called on each line, default console.log
  • options.cleanStack {Boolean}: if false won't clean stack trace from node internals, clean-stacktrace
  • options.shortStack {Boolean}: if false full stack traces, otherwise they are just four
  • options.showStack {Boolean}: if false the error.stack will be empty string
  • options.relativePaths {Boolean}: if false paths in stack traces will be absolute, clean-stacktrace-relative-paths
  • options.mapper {Function}: called on each line of the stack with (line, index) signature
  • options.cwd {String}: current working directory, default process.cwd()
  • returns {Function}: a plugin function that should be passed to .use method of minibase, base or dush

Example

const reporter = require('dush-tap-report')
const dush = require('dush')

const app = dush()

// provide a fake stats object
// so `finish` to work correctly
app.use(reporter({
  stats: {
    count: 3,
    pass: 2,
    fail: 1
  }
}))

const item = {
  index: 1,
  title: 'some passing test'
}
const failing = {
  index: 2,
  title: 'failing test, sorry',
  reason: new Error('some sad error here')
}
const item2 = {
  index: 3,
  title: 'awesome test is okey'
}

app.emit('start', app)
// => 'TAP version 13'

app.emit('pass', app, item)
// =>
// # :) some passing test
// ok 1 - some passing test

app.emit('fail', app, failing)
// =>
// # :( failing test, sorry
// not ok 2 - failing test, sorry

app.emit('pass', app, item2)
// =>
// # :) awesome test is okey
// ok 3 - awesome test is okey

app.emit('finish', app)
// =>
// 1..3
// # tests 3
// # pass  2
// # fail  1

Related

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Please read the contributing guidelines for advice on opening issues, pull requests, and coding standards.
If you need some help and can spent some cash, feel free to contact me at CodeMentor.io too.

In short: If you want to contribute to that project, please follow these things

  1. Please DO NOT edit README.md, CHANGELOG.md and .verb.md files. See "Building docs" section.
  2. Ensure anything is okey by installing the dependencies and run the tests. See "Running tests" section.
  3. Always use npm run commit to commit changes instead of git commit, because it is interactive and user-friendly. It uses commitizen behind the scenes, which follows Conventional Changelog idealogy.
  4. Do NOT bump the version in package.json. For that we use npm run release, which is standard-version and follows Conventional Changelog idealogy.

Thanks a lot! :)

Building docs

Documentation and that readme is generated using verb-generate-readme, which is a verb generator, so you need to install both of them and then run verb command like that

$ npm install verbose/verb#dev verb-generate-readme --global && verb

Please don't edit the README directly. Any changes to the readme must be made in .verb.md.

Running tests

Clone repository and run the following in that cloned directory

$ npm install && npm test

Author

Charlike Mike Reagent

License

Copyright © 2017, Charlike Mike Reagent. Released under the MIT License.


This file was generated by verb-generate-readme, v0.4.3, on March 19, 2017.
Project scaffolded using charlike cli.