I'm trying to create a module that I export and call from another file. My code is currently structured as it is below. When I call it from my main file, I get an error saying that my function, doSomething, does not exist. Is there a way to make this work? Should I be structuring my file differently or creating the instance of my object in the main file?
module.exports = function(){
var my_class = function(a){
this.init(a);
}
my_class.prototype = {
doSomething: (g) => {
// Doing something here
}
init: (b) () => {
doSomething();
}
}
return new my_class();
}