I'm simply trying to wait for a user to enter a password and then use it before moving on the rest of my code. The error is Cannot read property 'then' of undefined.  let rl = readline.createInterface({     input: process.stdin,     outpu...
I am creating a program to take input of two numbers from the command line and then showing there sum in node.js. I am using readline module to take stdin. Below is my code.  const readline = require('readline');  const rl = readline.createIn...
Is there a way to read a line from the Mongo shell? readline() is not defined and neither is system.stdin.  I need to do this in interactive mode, as opposed to feeding input to a script executed by the MongoDB shell....
I'd like to teach students how to program using JavaScript. I don't want to introduce new students to call-backs or any other complex program structure. Looking at Node.js the readline used for standard input uses a call-back. For simple inpu...
I'm trying to use readline inside an else if statement:  var rl = readline.createInterface({ input: process.stdin, output: process.stdout });  rl.question("Would you like to see which cars are available? Please type yes/no: ", function(an...
I have a "simple" problem that I cant seem to get around. Im just going to read input from standard input (terminal) and then save the input to a variable (here an array) and then print it all out to the terminal. When I try to paste in more...
What I'd like to do is hiding/erasing all users input from a nodejs console app once entered, so that when the user inserts some text and then types enter, he won't be able to read what he just entered in the console anymore (so basically rem...
I'm trying to do some algorithmic problems using Node's library of read lines : readline. (Actually, It was proposed by the course).  The input code was :   var readline = require('readline'); var lineNumber = 0;  process.stdin.setEnc...
I'm new to node.js and learning it on the fly. I have written a code to prompt for userinput from CLI with timeout. The problem is, the subsequent lines of code are executed and not paused while waiting for user input. how do i achieve this in no...
When I have multiple readline objects, even when they are opened and closed within the same closure, I end up seeing strange behavior.  In the tick tac toe game I am practicing making, I run into the issue where readline.interface.question terminates...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.