mirror of
https://kevinblog.sytes.net/Code/Jibo-Revival-Group/jibo-cli.git
synced 2026-06-16 03:36:10 +00:00
Initial commit — jibo-cli v3.0.7 with bundled node_modules
This commit is contained in:
35
node_modules/prompt/examples/add-properties.js
generated
vendored
Normal file
35
node_modules/prompt/examples/add-properties.js
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* add-properties.js: Example of how to add properties to an object using prompt.
|
||||
*
|
||||
* (C) 2010, Nodejitsu Inc.
|
||||
*
|
||||
*/
|
||||
|
||||
var prompt = require('../lib/prompt');
|
||||
|
||||
//
|
||||
// Start the prompt
|
||||
//
|
||||
prompt.start();
|
||||
|
||||
var obj = {
|
||||
password: 'lamepassword',
|
||||
mindset: 'NY'
|
||||
}
|
||||
|
||||
//
|
||||
// Log the initial object.
|
||||
//
|
||||
console.log('Initial object to be extended:');
|
||||
console.dir(obj);
|
||||
|
||||
//
|
||||
// Add two properties to the empty object: username and email
|
||||
//
|
||||
prompt.addProperties(obj, ['username', 'email'], function (err) {
|
||||
//
|
||||
// Log the results.
|
||||
//
|
||||
console.log('Updated object received:');
|
||||
console.dir(obj);
|
||||
});
|
||||
Reference in New Issue
Block a user