Closed stringparser closed 10 years ago
First point done, missing second.
Making second point its messy and has a lot of checkings. Point one its more useful and in fact, if one exported things on each file it has the same result. Is that an anti pattern? ... me does not know.
From the second point... is the callback useful? Yep, it is because it takes out the burden of having to throw in the middle of requiring, though that's probably less confusing... maybe split the functionality for this on a separate npm module
could be the solution. Splits the complexity and if something is needed it can be done there. Yep, doing that :)
Right now,
runtime.require
loads all files in a folder.From what is done already here are some thoughts about what could make it better.
runtime.require
should return it.index.js
should exist for that directory. If it doesn't exists create it.runtime.require
the first argument an error and the second themodule.exports
object of that folder so if necessary something can be done.