Files
pnpm/cli/default-reporter/bin/pnpm-render.mjs
Zoltan Kochan 6836547017 feat(default-reporter): add pnpm-render bin to render NDJSON from stdin (#11530)
- Adds a `pnpm-render` bin to `@pnpm/cli.default-reporter` that reads pnpm-shaped NDJSON from stdin and pipes it through the default reporter, so external tools that emit `pnpm:*` log records can reuse pnpm's renderer.
- Optional first positional arg sets the command name (defaults to `install`), e.g. `pnpm-render add` for piping output from `pacquet add`.

## Motivation

[Pacquet](https://github.com/pnpm/pacquet) emits pnpm-shaped `--reporter=ndjson` output for forward-compatibility with pnpm's renderer, but there was no way to actually render it. With this bin:

```sh
pacquet install --reporter=ndjson 2>&1 >/dev/null | pnpm-render
```

(pacquet writes NDJSON to stderr, so the redirect is needed.)
2026-05-08 01:56:54 +02:00

8 lines
149 B
JavaScript
Executable File

#!/usr/bin/env node
import { runCli } from '../lib/cli.js'
runCli(process.argv.slice(2)).catch((err) => {
console.error(err)
process.exit(1)
})