# @tapjs/node-serialize

> Stream TAP test data as a serialized node:test stream

Latest version **4.3.12** (published 2026-09-03) · BlueOak-1.0.0 license · 0 weekly downloads

## Install

```sh
npm install @tapjs/node-serialize
pnpm add @tapjs/node-serialize
yarn add @tapjs/node-serialize
bun add @tapjs/node-serialize
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 4.3.12 |
| Published | 2026-09-03 |
| First published | 2023-09-23 |
| Weekly downloads | 0 |
| License | BlueOak-1.0.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | 20 \|\| >=22 |
| Dependencies | 3 |
| Unpacked size | 123.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2426 |
| Author | Isaac Z. Schlueter |
| Maintainers | ljharb, isaacs |
| Keywords | v8, error, serialization, serialize, tapjs plugin, node --test, node:test, serdes |

## Links

- npm: https://www.npmjs.com/package/@tapjs/node-serialize
- Repository: https://github.com/tapjs/tapjs
- Homepage: https://github.com/tapjs/tapjs/tree/main/src/node-serialize#readme
- Issues: https://github.com/tapjs/tapjs/issues
- Funding: https://github.com/sponsors/isaacs
- npm.io page: https://npm.io/package/@tapjs/node-serialize

## Dependencies (3)

- [tap-parser](https://npm.io/package/tap-parser.md) 18.3.4
- [@tapjs/stack](https://npm.io/package/@tapjs/stack.md) 4.3.3
- [@tapjs/error-serdes](https://npm.io/package/@tapjs/error-serdes.md) 4.3.2

## Alternatives

- [@sentry/react-native](https://npm.io/package/@sentry/react-native.md) — 2.6M weekly downloads
- [@ardatan/aggregate-error](https://npm.io/package/@ardatan/aggregate-error.md) — 708.1K weekly downloads
- [custom-error-generator](https://npm.io/package/custom-error-generator.md) — 2.0K weekly downloads
- [@technik-sde/prosemirror-recreate-transform](https://npm.io/package/@technik-sde/prosemirror-recreate-transform.md) — 1.5K weekly downloads
- [@suchipi/error-utils](https://npm.io/package/@suchipi/error-utils.md) — 78 weekly downloads

## Recent versions

- 4.3.12 (latest) — 2026-09-03
- 4.3.11 — 2026-07-27
- 4.3.10 — 2026-05-15
- 4.3.9 — 2026-05-13
- 4.3.8 — 2026-05-01
- 4.3.7 — 2026-04-17
- 4.3.6 — 2026-04-15
- 4.3.5 — 2026-04-05
- 4.3.4 — 2026-02-20
- 4.3.3 — 2026-02-18
- 4.3.2 — 2026-02-18
- 4.3.1 — 2026-02-05
- 4.3.0 — 2025-12-01
- 4.2.1 — 2025-11-26
- 4.2.0 — 2025-11-25
- … 49 more at https://npm.io/package/@tapjs/node-serialize/versions

## README

# @tapjs/node-serialize

A default tap plugin that serializes the output of root `TAP`
test for consumption by the `node --test` runner.

That is, this is for running tests that you write like:

```js
import t from 'tap'
t.pass('this is fine')
// etc
```

and then run with `node --test`.

## USAGE

This plugin is installed with tap by default. If you had
previously removed it, you can `tap plugin add
@tapjs/node-serialize` to bring it back.

When enabled, this plugin is activated when the
`NODE_TEST_CONTEXT` environment variable is set to `child-v8`.
When so activated, the root `TAP` test outputs a stream of
`node:test` message objects (ie, the data emitted by Node's
[`TestStream`
class](https://nodejs.org/api/test.html#class-testsstream)) to
standard output, instead of piping TAP data to standard output.

It has no effect on other tests within the suite.

To disable this behavior, run `tap plugin rm
@tapjs/node-serialize`.

## Caveat about Timing

Node-tap and node's built-in `node:test` are not quite identical
in their approach.

Specifically, they have very different approaches to asynchronous
testing. When using `node:test`, all tests are placed in a queue,
and de-queued and started by level. It is considered an error for
a test to perform any asynchronous actions outside of the scope
of its parent suite method.

In tap, when `t.jobs` is set to some number greater than `1`,
tests may run in any order, and their subtests may _also_ run in
any order, at the same time as its siblings. While a subtest will
never start before its parent, it may start _after_ its parent's
sibling tests, making the apparent nesting get interleaved in a
strictly event-stream based tracking.

To handle this, this serializer creates a tree of subtests, and
only emits the relevant `node:test` event messages all at once,
in the correct order that `node --test` expects.

The downside of this is that it may appear that tests hang and
then emit all of their data at once. If true in-progress
reporting is desired, then you're probably better off using tap's
built-in test runner.

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