That is where it started but node.js has several non-standard additions to the 
module system that are not in the spec.

At this point you should consider node.js modules to be specific to node and 
not based on another standard. Sure, there are places where it matches 
Modules/1.1.1 but there are many places it does not and node.js will likely 
never adopt new commonjs standards like AMD.

On May 15, 2012, at May 15, 201212:57 PM, Angel Java Lopez wrote:

> Any relation with require in other context?
> 
> For example, require in CommonJs
> http://wiki.commonjs.org/wiki/Modules/1.1 
> 
> require "was not born" in Node.js, it has a previous story, and I guess 
> Node.js team adopted the previous work.
> 
> On Tue, May 15, 2012 at 4:50 PM, Jorge <jo...@jorgechamorro.com> wrote:
> Async is always best, but sometimes not :-P
> 
> On May 15, 2012, at 8:30 PM, Martín Ciparelli wrote:
> 
> > So the question would be: why an async-driven platform uses sync-driven way 
> > to load modules?
> >
> > 2012/5/15 Marak Squires <marak.squi...@gmail.com>
> > require() is a sync call.
> >
> > If you need an async require ( a require that performs i/o ), you should 
> > check out a plugin system like Broadway ( 
> > https://github.com/flatiron/broadway )
> >
> > This will allow you to require modules with an optional .init and .attach 
> > methods, which can both accept optional callbacks.
> >
> >
> > On Tue, May 15, 2012 at 8:49 AM, Guoliang Cao <gca...@gmail.com> wrote:
> > Hi,
> >
> > I'm new to Node.js and wrapping my head around the asynchronous programming 
> > model. A question comes to mind is why 'require' itself does not use 
> > callbacks like below. I believe IO is involved in require and a lot of 
> > things can fail.
> >
> > require('http',
> > function(http){
> >    // do stuff with http
> > },
> > function(error) {
> >    console.log("Failed to load http");
> > });
> >
> >
> > Thanks,
> > Guoliang Cao
> >
> > --
> > 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 nodejs@googlegroups.com
> > To unsubscribe from this group, send email to
> > nodejs+unsubscr...@googlegroups.com
> > For more options, visit this group at
> > http://groups.google.com/group/nodejs?hl=en?hl=en
> >
> >
> >
> > --
> > --
> > Marak Squires
> > Co-founder and Chief Evangelist
> > Nodejitsu, Inc.
> > marak.squi...@gmail.com
> >
> >
> > --
> > 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 nodejs@googlegroups.com
> > To unsubscribe from this group, send email to
> > nodejs+unsubscr...@googlegroups.com
> > For more options, visit this group at
> > http://groups.google.com/group/nodejs?hl=en?hl=en
> >
> >
> > --
> > 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 nodejs@googlegroups.com
> > To unsubscribe from this group, send email to
> > nodejs+unsubscr...@googlegroups.com
> > For more options, visit this group at
> > http://groups.google.com/group/nodejs?hl=en?hl=en
> 
> --
> 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 nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
> 
> 
> -- 
> 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 nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en

-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to