I keep all common methods for server & client inside of /lib
directory following the Meteor doc.
I do want keep some code separation for different utilities, so I have /lib/userUtils.js
and /lib/messageUtils.js
.
Inside of each of these classes. I want to have something like:
/lib/userUtils.js
UserUtils.findUser = function(user) {
...
}
/lib/messageUtils.js
MessageUtils.findMessage = function(id) {
...
}
This doesn't work in Meteor right now though. I would typically do function UserUtils() {}
to statically define utility name first. But I just get UserUtils not found
exception in my log.