1 var prompt = require('prompt');
2
3 //
4 // Start the prompt
5 //
6 prompt.start();
7
8 //
9 // Get two properties from the user: username and email
10 //
11 prompt.get(['username', 'email'], function (err, result) {
12 //
13 // Log the results.
14 //
15 console.log('Command-line input received:');
16 console.log(' username: ' + result.username);
17 console.log(' email: ' + result.email);
18 });