# tap_parser

> Stream that receives TAP, parses it, and emits objects of parsed TAP.

Latest version **1.0.4** (published 2017-02-09) · CC0-1.0 license · 0 weekly downloads

## Install

```sh
npm install tap_parser
pnpm add tap_parser
yarn add tap_parser
bun add tap_parser
```

Provides the command `tap_parser`.

## 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.4 |
| Published | 2017-02-09 |
| First published | 2016-10-03 |
| Weekly downloads | 0 |
| License | CC0-1.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Johnny Hauser |
| Maintainers | m59 |

## Links

- npm: https://www.npmjs.com/package/tap_parser
- Repository: https://github.com/m59peacemaker/node-tap-parser
- Homepage: https://github.com/m59peacemaker/node-tap-parser#readme
- Issues: https://github.com/m59peacemaker/node-tap-parser/issues
- npm.io page: https://npm.io/package/tap_parser

## Dependencies (6)

- [throo](https://npm.io/package/throo.md) ^1.0.0
- [js-yaml](https://npm.io/package/js-yaml.md) ^3.6.1
- [duplexer](https://npm.io/package/duplexer.md) ^0.1.1
- [through2](https://npm.io/package/through2.md) ^2.0.1
- [tap-lexer](https://npm.io/package/tap-lexer.md) ^1.0.2
- [tap-line-parsers](https://npm.io/package/tap-line-parsers.md) ^1.0.1

## Recent versions

- 1.0.4 (latest) — 2017-02-09
- 1.0.3 — 2016-10-24
- 1.0.2 — 2016-10-03
- 1.0.1 — 2016-10-03

## README

# tap_parser

Stream that receives TAP, parses it, and emits objects of parsed TAP.

Adheres strictly and entirely to the [TAP13 Specification](https://testanything.org/tap-version-13-specification.html).

## install

```sh
npm install tap_parser
```

## example

```js
const parser = require('tap_parser')
const though = require('throo')

process.stdin
  .pipe(parser())
  .pipe(through((push, chunk, enc, cb) => {
    chunk // object of parsed TAP
  }))
```

```sh
# output parsed TAP as JSON
npm test | tap_parser
```

## parsed TAP

All objects have this structure:

- type: Type of TAP (version, plan, test, etc)
- value: The original TAP that was input
- parsed: Object representation of TAP (see below)

Lines that are not TAP will have `type: 'unknown'` and will not have a "parsed" property.

### version

- version: `string`

### plan

- start: `number`
- end: `number`
- skip: `string`

### test

- ok: `boolean`
- point: `number`
- description: `string`
- skip: `boolean | string` Will be `string` if there is a message, `true` if not
- todo: `boolean | string` Will be `string` if there is a message, `true` if not
- document: `object` Parsed YAML document

### bailout

- reason: `string`

### diagnostic

- message: `string`

### unknown

## notes

Test lines may or may not be followed by an associated document. The parser will hold test lines until the next line comes in so that the document can be parsed and added to the test. This is usually not important to know, but this can be a "gotcha" in some cases. For example, a test that writes a test line to the stream and nothing afterward will hang waiting for another line.

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