I found this thread while looking for the reason why the "directories.lib" 
was dropped a couple years ago 
(reason: https://groups.google.com/d/topic/nodejs/hAoPAPz4J1k/discussion). 
While 
Izaacs have some pretty good points I still want this feature into node 
core... Other CommonJS environments like RingoJS supports it and it can be 
useful in some cases (like described by Osher).

I guess most people would be OK if the "directories.lib" was hardcoded as 
"lib" -> so `require("foo/bar")` would look for "bar" at "foo" root folder 
and if not found look it inside the "foo/lib" folder (like "index.js" files 
are resolved when you require a folder) - the "lib" directory is already a 
convention on the nodejs community.

Every project already contains a lot of other files at the root folder 
(package.json, .gitignore, build script, readme, etc..) so putting even 
more stuff into the root folder feels "wrong".

The issue is not about the extra 4 chars ("lib/") but about having 
different require paths depending on the environment, code will be less 
portable.

PS: I do NOT want to start a discussion about keeping everything as 
separate packages, I really want a "kitchen sink" for this case. I'm not 
the first one to want this feature and I probably won't be the last one.

Cheers.

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

Reply via email to