Created
November 16, 2012 23:56
-
-
Save wankdanker/4092024 to your computer and use it in GitHub Desktop.
for xp_prg
This file contains hidden or 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
var prompt = require('prompt'); | |
var result2 = []; | |
//not sure what this does so don't know when it should be called. | |
prompt.start(); | |
function getData() { | |
prompt.get(['username', 'email'], function (err, result) { | |
if (err) { return onErr(err); } | |
console.log('Command-line input received:'); | |
console.log(' Username: ' + result.username); | |
console.log(' Email: ' + result.email); | |
result2.push(result.username); | |
console.log("_dbg loop #: " + (result2.length - 1) +" result2: " + JSON.stringify(result2[result2.length - 1]) + "\n"); | |
if (result2.length <= 10) { | |
getData(); | |
} | |
}); | |
function onErr(err) { | |
console.log(err); | |
return 1; | |
} | |
} | |
getData(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment