// Step 1: Import the 'readline' module
const readline = require('readline');
// Step 2: Create a readline interface
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
// Step 3: Set up an event listener for the 'line' event
rl.on('line', (input) => {
// Step 4: Print the input received from stdin
console.log('You entered:', input);
// Step 5: Close the readline interface
rl.close();
});
// Step 6: Display a prompt to the user
rl.setPrompt('Enter something: ');
// Step 7: Display the prompt to the user
rl.prompt();