Tizen 2.1 base
[platform/framework/web/web-ui-fw.git] / libs / js / jquery-mobile-1.2.0 / node_modules / grunt / node_modules / prompt / examples / add-properties.js
1 /*
2  * add-properties.js: Example of how to add properties to an object using prompt.  
3  *
4  * (C) 2010, Nodejitsu Inc.
5  *
6  */
7  
8 var prompt = require('../lib/prompt');
9
10 //
11 // Start the prompt
12 //
13 prompt.start();
14
15 var obj = {
16   password: 'lamepassword',
17   mindset: 'NY'
18 }
19
20 //
21 // Log the initial object.
22 //
23 console.log('Initial object to be extended:');
24 console.dir(obj);
25
26 //
27 // Add two properties to the empty object: username and email
28 //
29 prompt.addProperties(obj, ['username', 'email'], function (err) {
30   //
31   // Log the results.
32   //
33   console.log('Updated object received:');
34   console.dir(obj);
35 });