Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

input in node js

const readline = require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
});
 
readline.question('who are you: ', name => {
	console.log(`hello, hi there ${name}`);
	readline.close();
})
Comment

getting user input in node js

//Make sure you have Node and NPM installed
//Run "npm install prompt-sync" in the terminal
const prompt = require('prompt-sync')();

const name = prompt('What is your name?');
console.log(`Hey there ${name}`);
Comment

Nodejs user input

// Importing the module
const readline = require("readline-sync");
  
// Enter the number
let a = Number(readline.question());
let number = [];
for (let i = 0; i < a; ++i) {
  number.push(Number(readline.question()));
}
console.log(number);
Comment

PREVIOUS NEXT
Code Example
Javascript :: file upload with progress bar 
Javascript :: how to delete object in array 
Javascript :: make indexOF in js 
Javascript :: react native cors origin 
Javascript :: what is auth guard in angular 
Javascript :: rename files in folder 
Javascript :: angular loop through array 
Javascript :: + javascript 
Javascript :: how to display a calender in react native 
Javascript :: js windowresize event 
Javascript :: how can i use exact in react router dom v6 
Javascript :: jquery method 
Javascript :: remove two things from javascript string 
Javascript :: how to check if an element already exists in an array in javascript 
Javascript :: display none after hover 
Javascript :: js function definition 
Javascript :: javascript map mdn 
Javascript :: ex:javascript 
Javascript :: react lifecycle hooks 
Javascript :: js classlist multiple classes 
Javascript :: materialze 
Javascript :: web application development software 
Javascript :: how to check if a number is negative in p5.js 
Javascript :: js.l6 
Javascript :: how to disable autonumeric js 
Javascript :: JAVASCRIPT FILTRER TABLEAU MULTIDIMENSIONNEL 
Javascript :: ascending order sort javascript without sort function 
Javascript :: Pure JavaScript Send POST NO JQUERY 
Javascript :: JS urdsathdzygo8sdhurj.hdo78suij 
Javascript :: await zoomus.joinmeeting crashing app react native 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =