stringparser / runtime

a runtime interface
4 stars 1 forks source link

Changes on `runtime.require` #5

Closed stringparser closed 10 years ago

stringparser commented 10 years ago

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.

stringparser commented 10 years ago

First point done, missing second.

stringparser commented 10 years ago

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 :)