https://github.com/vanng822/app-require
customized require for app
https://github.com/vanng822/app-require
Last synced: about 2 months ago
JSON representation
customized require for app
- Host: GitHub
- URL: https://github.com/vanng822/app-require
- Owner: vanng822
- License: mit
- Created: 2013-11-16T15:01:05.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-03-04T20:17:32.000Z (about 11 years ago)
- Last Synced: 2025-02-20T06:47:49.024Z (2 months ago)
- Language: JavaScript
- Homepage:
- Size: 164 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
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)
* `root` Default path, should be absolute path, if not set this will assume the current working directory### requireLib(path)
* `path` path to lib folder, that is {path}/lib, default to root above.### requireConfig(path)
* `path` path to config folder, that is {path}/config, default to root above.### require(id, path)
* `id` module id/name or relative path
* `path` path to load the id above, default to root above.## usage
Idea for application with structure as bellow-approot/
----server.js
----/config/
----/lib/
....