Skip to content

Instantly share code, notes, and snippets.

@incompl
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save incompl/4fbe91f43b1d3c08cc63 to your computer and use it in GitHub Desktop.
Save incompl/4fbe91f43b1d3c08cc63 to your computer and use it in GitHub Desktop.
var Egg = require('egg.js');
Egg.publicMethod();
var Person = require('ConstructorExample.js');
var greg = new Person('Greg');
function Person(name) {
this.name = name;
}
Person.prototype = {
getNameQuestion: function() {
return this.name;+ '?';
}
};
module.exports = Person;
var privateValue;
function privateMethod() {
}
module.exports = {
publicMethod: function() {
return privateMethod();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment