UNPKG

@kubb/cli

Version:

Command-line interface for Kubb, enabling easy generation of TypeScript, React-Query, Zod, and other code from OpenAPI specifications.

18 lines (15 loc) 581 B
import type { WritableOptions } from 'node:stream' import { Writable } from 'node:stream' import { styleText } from 'node:util' import type * as clack from '@clack/prompts' export class ClackWritable extends Writable { taskLog: ReturnType<typeof clack.taskLog> constructor(taskLog: ReturnType<typeof clack.taskLog>, opts?: WritableOptions) { super(opts) this.taskLog = taskLog } _write(chunk: any, _encoding: BufferEncoding, callback: (error?: Error | null) => void): void { this.taskLog.message(`${styleText('dim', chunk?.toString())}`) callback() } }