@wycats npm used to have a "modules" field for that. It was a huge mistake.
I am looking for a way to do require("mypackage/foo") but store that file in mypackage/lib/foo.js
-
-
-
@substack can you explain why it was a huge mistake? what huge problems did it cause? -
@wycats nobody knew how it worked, the symlinks weren't portable, and it made everything really complicated https://groups.google.com/forum/?fromgroups=#!searchin/npm-/modules$20package.json/npm-/hAoPAPz4J1k/PyGdLOc0tWEJ … -
-
@millermedeiros a solution is only “dismissed out of hand” if you’re attacking a standards body. Node’s lame excuses are Unixy!@substack -
@wycats@millermedeiros the big difference is that standards bodies have monopoly power over all the browsers while userland projects don't -
@substack standards bodies have no "monopoly power". They derive their power from the fact that vendors agree through them@millermedeiros
End of conversation
New conversation -
-
-
@wycats people just have to require the real path -
@ryanflorence Really, I'm about to start a fight? Node people are far more religious than I realized. What is a "real path" anyway? -
@wycats Have you read the npm FAQ? /cc@ryanflorence
End of conversation
New conversation -
-
-
@wycats do you have a blog post that talks about minispade? I'm looking for a simple "modules for JS 101 done right" -ie (why use it /etc) -
@toranb@wycats http://tomdale.net/2012/01/amd-is-not-the-answer/ … tom's blog post deals w/ this somewhat indirectly but if you haven't read it it may be useful -
@stv_kn awesome! Thanks for the reference!
End of conversation
New conversation -
-
-
@wycats if you use google closure you can accomplish something similar with goog.provide and goog.requireThanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
@wycats var mypackage = require('mypackage') // mypackage exports foo required from wherever you like. foo = mypackage.fooThanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
@wycats export it in your main module, as a getter if you really want lazy loading, and require('mypkg').foo export all the things :)Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
@wycats symbolic links are your friend.Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
@wycats is using regex too obvious?Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
@wycats I would think you could have a mypackage/foo/index.js file that then references the other file(s) in /libThanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
@wycats How about setting it explicitly in require.config?Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.