ReadLine Node Js

const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, output: process.stdout, prompt: '\nIngrese algo: ' }); rl.prompt(); rl.on('line', (line) => { console.log(`Escribiste: ${line}`); rl.prompt(); }).on('close', () => { console.log('\n Termino'); process.exit(0) });

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.