Created
February 29, 2016 21:55
-
-
Save dgroup/35e629fcf4bd55727aa1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var db = require('db'); // if 'ru.js' not found, NodeJS will automatically found ru.json/ru.node/'ru' directory | |
var log = require('logger')(module); | |
function User(name){ | |
this.name = name | |
} | |
User.prototype.hello = function (who) { | |
log(db.getPhrase("Hello") +' '+ who.name) | |
}; | |
log("Module \"User\" was activated."); | |
// Public API of module | |
module.exports = User; // allows to use function without intermediate code var c = require('user'); | |
//exports.User = User; | |
//this.User = User; // this = exports, but there is a problem with functions | |
// Public Global object of module | |
global.Lang = "EN"; | |
// Information about current module | |
// console.log(module); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment