Every line of 'webprompt' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
109 async function readPrompt(p: string): Promise { 110 var rl = readline.createInterface({ 111 input: process.stdin, 112 output: process.stdout 113 }); 114 return new Promise(function(resolve){ 115 rl.question(p, function(ans){ 116 rl.close(); 117 resolve(ans); 118 }); 119 }); 120 }
377 async function prompt() { 378 const rl = readline.createInterface({ 379 input: process.stdin, 380 output: process.stdout 381 }); 382 383 await new Promise(resolve => { 384 rl.question( 385 "WARNING: this operation will delete resources. Confirm? [y/N] ", 386 answer => { 387 if (answer !== "y") { 388 log(`Execution aborted.`); 389 process.exit(0); 390 } 391 rl.close(); 392 resolve(); 393 } 394 ); 395 }); 396 }
107 function prompt(callback) 108 { 109 rl.setPrompt("# "); 110 rl.question('# ', callback); 111 }