I recently tried to expose a module that looked a bit like:
module.exports = {
user: {
get: function(id){...},
remove: function(id){...},
},
users: {
get: function(){... return all ...},
}
};
I'm actually using a wrapper around the client call that allows me to reference methods like:
myclient.user.get(123,function(data){
console.log('Got user',data);
});
Anyhow, this is more of a feature request. I'd like the ability to namespace my modules as shown above. The work is already done (see below).
@visionmedia - I don't know if this fits in with your vision of axon-rpc or not. It shouldn't affect current functionality, but I wasn't able to run the tests (they failed on a raw clone of the repo, i.e. before I made any changes). Anyhow, I setup a PR with my additions. It's yours for the taking. Either way, I personally have a need for this functionality via npm. I have no problem publishing it separately, but if you end up keeping it, let me know so I don't needlessly duplicate a module. npm has enough clutter already.