--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
I wrote an async require last week as a test. Since you can in fact require('module') and interact with the stuff in there it's pretty easy to go async with it.
of course you do loose some benefits such as automatic load ordering, but if performance in loading a lot of modules is your concern, then that might be a way to go.
have a look at https://github.com/joyent/node/blob/master/lib/module.js and you'll see that the module loader is actually quite simple.
If you need help, give me a shout out, as I said I played with something similar last week but killes it as overkill for my scenario.
ok, so far I have not heard a technical reason. the fact that require() returns module.exports obviously would have to change to AMD require with callback. And the order of modules could probably be ensured by using a similar approach as requireJS load order (http://requirejs.org/docs/1.0/docs/api.html#order).