index.js 510 B

1234567891011121314151617181920212223
  1. var hello = require('../othermodule.js'); // require a second ("child") mondule
  2. // micro-module to test functionality
  3. (function() {
  4. 'use strict';
  5. var runcount = false;
  6. console.log("Hello module says: " + hello()); // super useful module ;-)
  7. var get = function () {
  8. return runcount;
  9. }
  10. var set = function () {
  11. runcount = runcount + 1;
  12. return runcount;
  13. }
  14. module.exports = {
  15. get: get,
  16. set: set
  17. };
  18. }()); // benalman.com/news/2010/11/immediately-invoked-function-expression