()
| 91 | * `-` is given, and as the implicit input for `zn capture`. |
| 92 | */ |
| 93 | export async function readStdin(): Promise<string> { |
| 94 | if (process.stdin.isTTY) return '' |
| 95 | const chunks: Buffer[] = [] |
| 96 | for await (const chunk of process.stdin) { |
| 97 | chunks.push(typeof chunk === 'string' ? Buffer.from(chunk) : chunk) |
| 98 | } |
| 99 | return Buffer.concat(chunks).toString('utf8') |
| 100 | } |
| 101 | |
| 102 | /** |
| 103 | * Resolve `--body` / positional body conventions: |
no outgoing calls
no test coverage detected