createOutput
Generated reference page for the createOutput function export.
- Import:
@kjanat/dreamcli - Export kind: function
- Declared in:
src/core/output/index.ts - Source link:
packages/dreamcli/src/core/output/index.ts:586
Signatures
ts
function createOutput(options?: OutputOptions): Out;| Parameter | Type | Description |
|---|---|---|
options | OutputOptions | undefined | Optional configuration. When omitted, output is discarded (useful for silent test runs). Pass stdout/stderrwriters to direct output somewhere useful. |
Members
Members
createOutput
Create an output channel.
Low-level factory: action handlers already receive out automatically from cli(), .execute(), and runCommand(). Call createOutput() when you are embedding DreamCLI primitives into a custom runtime or need a standalone output implementation outside the normal command pipeline.
ts
(options?: OutputOptions): Out;Examples
ts
// Production (wired by the runtime adapter)
const out = createOutput({
stdout: (s) => process.stdout.write(s),
stderr: (s) => process.stderr.write(s),
isTTY: process.stdout.isTTY === true,
});
// Test (capture output)
const lines: string[] = [];
const out = createOutput({
stdout: (s) => lines.push(s),
stderr: (s) => lines.push(s),
});