# tap-stream-reporter

> A Test-Anything-Protocol report library for JavaScript

Latest version **1.0.0** (published 2020-04-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install tap-stream-reporter
pnpm add tap-stream-reporter
yarn add tap-stream-reporter
bun add tap-stream-reporter
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2020-04-03 |
| First published | 2020-04-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 20.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | hudovisk |

## Links

- npm: https://www.npmjs.com/package/tap-stream-reporter
- Repository: https://github.com/hudovisk/tap-stream-reporter
- Homepage: https://github.com/hudovisk/tap-stream-reporter#readme
- Issues: https://github.com/hudovisk/tap-stream-reporter/issues
- npm.io page: https://npm.io/package/tap-stream-reporter

## Dependencies (1)

- [tap-parser](https://npm.io/package/tap-parser.md) ^10.0.1

## Recent versions

- 1.0.0 (latest) — 2020-04-03
- 0.1.1 — 2020-04-02
- 0.1.0 — 2020-04-02

## README

# tap-stream-report

This package is based on [tap-mocha-reporter](https://github.com/tapjs/tap-mocha-reporter). The reasoning behind this package is that tap-mocha-reporter is very dependent on `process.stdout` as its output, so the idea is to turn the reporter into a `Transform` stream and doing so it enables us to read it's output to whatever destination we like.

## Currently supported reporters
 - spec
 - summary

## Usage:

```javascript
const stream = require("stream");
const util = require("util");
const Reporter = require("tap-stream-reporter");

const pipeline = util.promisify(stream.pipeline);

async function() {
  // This is necessary because if we do not invoke pipe on
  // tap it defaults to process.stdout
  const passthrough = new stream.PassThrough();
  tap.pipe(passthrough);
  
  // TESTS GO HERE
  // tap.test....;
  
  tap.end();
  
  const reporter = new Reporter("spec");
  
  // according to some maintainers, pipeline is the recommended way
  // to glue streams together
  // ref: https://www.youtube.com/watch?v=aTEDCotcn20
  await pipeline(passthrough, reporter);
  
  let report = "";
  for await (const chunk of reporter) {
    report += chunk.toString();
  }
  
  console.log(report);
}
```

---
_Source: https://npm.io/package/tap-stream-reporter · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
