Questions tagged [readline-sync]

9 questions
1
vote
1 answer

Unexpected behavior with setInterval and readlineSync

I have written a small function to animate some multi line strings. It takes an array of strings that it will log. It uses set interval to run the function that will log the frames. Then when their are no frames left clear interval runs and a…
0
votes
0 answers

print received messages on server side in nodejs net module

I am beginner in nodejs and i want to create a simple program that print received massage from client side until user enter '.exit'. but nothing is printed in server side, until the user enters the '.exit' and all the sent messages are printed…
0
votes
2 answers

Node.js user input wont work, readline-sync and error code 134

I'm coding a project in node.js on vs code and need an user input for various functions. I tried many libraries such as readline-sync or prompt-sync-plus but none of them work for me. While using readline-sync I always get the error: Process exited…
Adrian
  • 1
  • 2
0
votes
0 answers

getting wrong answer for finding largest of 2 numbers using readline-sync in js

if I enter 55 and 23, it shows correct output as 'Largest number is 55' But if I enter 12 and 3, it shows incorrect output as 'Largest number is 3' (i guess the program is reading only the first letter of the input value) var…
0
votes
1 answer

How to display prompts and command outputs simultaneously in Nodejs?

I am trying to make a shell environment using Nodejs and encountered the following flaw in my program. I tried using the readline-sync and prompt-sync for resolving the issue and described about the problem next. I am having the below code: const…
0
votes
0 answers

How do I use readlineSync to ask a user for input then put it into an array as individual values

[](https://i.stack.imgur.com/bbOHh.png I have an assignment for class but I am not sure how to separate the values entered and store them into the array. Any help would be appreciated I tried just asking the question once and hoping the program…
Dilax
  • 1
0
votes
0 answers

How to replace .questionInt() response when user inputs invalid entry in node.js readline-sync?

The automatic message a user gets when inputting an invalid response into a .questionInt('Type a number') when using node.js readline-sync module 'a' Input valid number, please. How do I change the response from 'Input valid number, please.' to…
N00bDev
  • 1
  • 1
0
votes
0 answers

How can I get the value from a string and write it in an output text file more than one time with it making new lines every time?

How can I get the value from a string and write it in an output text file more than one time with it making new lines every time? So I am trying to make a demo for how to save like user input in HTML to a text file using javascript, but I am not…
0
votes
0 answers

How to get readline-sync working in JavaScript in VisualStudioCode?

I would like to allow a JavaScript program running in VisualStudioCode to use readline-sync, but when I try to use the const input = require('readline-sync'); line that works in environments like Replit after causing that module to be added, I get…