You are trying to export a ConversationModule as a function that it is not. Use this instead:
exports.ConversationModule = ConversationModule;
Since you also assign the variable as the exports property, you should call it like this:
var ConversationModule = require('./file').ConversationModule; ConversationModule.sayhello();
If you do not want to do this, assign a module.exports object:
module.exports = ConversationModule;
And name it as follows:
var ConversationModule = require('./file'); ConversationModule.sayhello();
hexacyanide
source share