I would suggest using the Input-Deno module. This is an example from the docs:
// For a single question:
const input = new InputLoop();
const nodeName = await input.question('Enter the label for the node:');
// output:
// Enter the label for the node:
// Return Value:
// 'a'