Johnhhorton
2/22/2017 - 4:07 AM

node-module-exports-1.js

//function example
module.exports = function(){
    console.log(`I'm an exported function`)
}

//object example
module.exports = {
    var1: 'var1',
    myMethod(){
        this.var1 = 'hello world'
        return this.var1
    }
}