Re: [nodejs] Best way to organize modules which has dependencies

2012-03-24 Thread Martin Lundberg
On Saturday, March 24, 2012 4:05:15 AM UTC+1, Tim Caswell wrote: That's actually not a bad model. The connect middleware system I designed works like that. Each middleware is a standalone module. It may depend on some other modules for functionality (the static file server module depends

[nodejs] Best way to organize modules which has dependencies

2012-03-23 Thread Martin Lundberg
Hi, I'm curious convention on how to design modules which has dependencies. For example if I've got an auth module with a function called authenticate which in turn uses a UserRepository object (which in turn uses a database library object like node-mysql) which communicates with the database,

Re: [nodejs] Best way to organize modules which has dependencies

2012-03-23 Thread Tim Caswell
That's actually not a bad model. The connect middleware system I designed works like that. Each middleware is a standalone module. It may depend on some other modules for functionality (the static file server module depends on the mime database module). But as far as runtime configuration and