import Mute from 'mute-stream'; import { createInterface } from 'readline'; export async function read({ default: def, input = process.stdin, output = process.stdout, completer, prompt = '', silent, timeout, edit, terminal, replace, }) { if (typeof def !== 'undefined' && typeof def !== 'string' && typeof def !== 'number') { throw new Error('default value must be string or number'); } let editDef = false; const defString = def?.toString(); prompt = prompt.trim() + ' '; terminal = !!(terminal || output.isTTY); if (defString) { if (silent) { prompt += '(