A Simple Moudle Loader
Install
NodeJS >= 4.6.0
~ npm install clmloader
It's an better idea use this module with cl-router
Usage
const clmLoad = ; ;
router.js
Example module { return Promise;};
Directory Struct
- target_dir
- module1
- router.js
- module2
- router.js
Load results:
{
dir2: {
test: 2,
common: 'xx',
path: 'clmloader/tests/examples-1/dir2',
name: 'dir2'
},
dir1:{
test: 1,
path: 'clmloader/tests/examples-1/dir1',
name: 'dir1',
common: 'xx'
}
}
If you load with attach
, then result map sub object will all has common
.