read input data from terminal with prompt

This commit is contained in:
ericdouglas 2015-06-01 11:44:43 -03:00
parent 7b02d7403f
commit 92778f9ed0

View File

@ -1,18 +1,14 @@
// Modules
var prompt = require( 'prompt' );
// // Modules
// var prompt = require( 'prompt' );
// Create a variable x and assign value 3 to it
var x = 3;
// // Create a variable x and assign value 3 to it
// var x = 3;
// Bind x to value 9
x *= x; // or x = x * x;
console.log( x );
// // Bind x to value 9
// x *= x; // or x = x * x;
// console.log( x );
// read input data from terminal
process.stdin.resume();
console.log( '' );
prompt.start();
prompt.get({
name : 'number',
@ -55,4 +51,4 @@ prompt.get({
// });
// Find the lowest of three numbers
// // Find the lowest of three numbers