# @tapjs/spawn

> a built-in tap extension for t.spawn()

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

## Install

```sh
npm install @tapjs/spawn
pnpm add @tapjs/spawn
yarn add @tapjs/spawn
bun add @tapjs/spawn
```

## 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-08-04 |
| Weekly downloads | 0 |
| License | BlueOak-1.0.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | 20 \|\| >=22 |
| Dependencies | 0 |
| Unpacked size | 21 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2423 |
| Author | Isaac Z. Schlueter |
| Maintainers | ljharb, isaacs |
| Keywords | tapjs plugin |

## Links

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

## Recent versions

- 4.3.12 (latest) — 2026-09-03
- 1.0.0 (pre) — 2023-09-15
- 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
- … 75 more at https://npm.io/package/@tapjs/spawn/versions

## README

# `@tapjs/spawn`

A default tap plugin providing `t.spawn()`.

## USAGE

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

### Interface `SpawnOpts`

Options for `t.spawn()`

All of the normal Base and Extra options are also allowed.

- `cwd` - string, the current working directory of the subprocess
- `env` - Environment variables for the subprocess. Defaults to
  `process.env`
- `stdio` - ChildProcess `stdio` option. Standard output is
  always set to `'pipe'`, because that's how it communicates test
  results, and file descriptor 3 is set to an IPC channel for
  sending timeout signals.
- `command` (internal) - the command to run (set by first
  argument to t.spawn)
- `args` (internal) - arguments to subprocess (set by second
  argument to t.spawn)
- `exitCode` (internal) - Set on exit. The exit code of the
  process, or null if terminated with a signal.
- `signal` (internal) - Set on exit. Terminating signal, or null
  of not terminated with a signal.

### `t.spawn(cmd, [args], [options], [name]): PromiseWithSpawn`

Arguments:

- `cmd` `string` - The command to run
- `args` (optional) `string | string[]` - Arguments to pass to
  the command.
- `options` (optional) `SpawnOpts` object

Spawns a process when the test starts, parsing its standard
output as a TAP stream.

This is how the tap CLI runs test programs.

Returns a Promise that resolves when the test is complete. The
`subtest` member on the Promise is a
[`Spawn`](https://tapjs.github.io/tapjs/classes/_tapjs_core.spawn.Spawn.html)
instance.

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