0.1.1 • Published 12 years ago
app-require v0.1.1
app-require
customized require for app. For sharing libs and easier to require with long relative path, ie ../.., easier to restructure code.
methods
setup(root)
rootDefault path, should be absolute path, if not set this will assume the current working directory
requireLib(path)
pathpath to lib folder, that is {path}/lib, default to root above.
requireConfig(path)
pathpath to config folder, that is {path}/config, default to root above.
require(id, path)
idmodule id/name or relative pathpathpath to load the id above, default to root above.
usage
Idea for application with structure as bellow
-approot/
----server.js
----/config/
----/lib/
....