By mswatcher
via openmymind.net
Submitted: Jun 27 2012 / 09:32
To recap the original post, module.exports is how we make something within our file publicly accessible to anything outside our file. We can export anything: a class, a hash, a function or a variable. When you require something you get whatever it exported. That means that the return value from require can be a class, a hash, a function or a variable. The end result is that how the value returned from require is used can vary quite a bit:
Tweet
SaveShareSend
Tags: frameworks, javascript, server
Add your comment