Skip to content

Instantly share code, notes, and snippets.

@dgroup
Created February 29, 2016 21:55
Show Gist options
  • Save dgroup/35e629fcf4bd55727aa1 to your computer and use it in GitHub Desktop.
Save dgroup/35e629fcf4bd55727aa1 to your computer and use it in GitHub Desktop.
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