mirror of https://github.com/vitalif/phantomjs
Add a simple example to show how the module system works.
http://code.google.com/p/phantomjs/issues/detail?id=471.7
parent
0ce2974ff7
commit
0632658afe
|
@ -0,0 +1,4 @@
|
|||
var universe = require('./universe');
|
||||
universe.start();
|
||||
console.log('The answer is', universe.answer);
|
||||
phantom.exit();
|
|
@ -0,0 +1,8 @@
|
|||
// This is to be used by module.js example.
|
||||
|
||||
exports.answer = 42;
|
||||
|
||||
exports.start = function () {
|
||||
console.log('Starting the universe....');
|
||||
}
|
||||
|
Loading…
Reference in New Issue