Last active
May 1, 2019 00:27
-
-
Save topherPedersen/7a3d5bf75e16681cb62fa08b6c2cb2d8 to your computer and use it in GitHub Desktop.
Command-Line User Input in JavaScript (node.js)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// User Input in NodeJS by Timmy Chen, Jaxatax, & topherPedersen | |
const readLine = require("readline-sync"); | |
function input(prompt) { | |
const userInput = readLine.question(prompt) | |
return(userInput) | |
} | |
var myString = input("User Input Prompt: "); | |
console.log(myString); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment