JavaScript Modules: A Beginner’s Guide
Preethi Kasireddy
3.6K99

Hi there

nice article :)

I think just a typo

the node module should be

function myModule() {
 this.hello = function() {
 return ‘hello!’;
 }

this.goodbye = function() {
 return ‘goodbye!’;
 }
}

module.exports = new myModule();

var myModule = require(‘./myModule’);

Show your support

Clapping shows how much you appreciated Fabio Bedini’s story.