So I set off by creating a file named dateFormatter.js that looked something like this:
What I didn't understand was that modules in node.js are wrapped as objects for you.
So by using the exports. I was really defining the public interface of my object. So, I changed the code to this:
And then I reference and use it like this:
At the moment, this works for me.