Constructor
new FileLoader(options)
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options
|
Object | options Properties
|
- Since:
- 1.0.0
- Source:
Methods
load() → {Object}
attach items to target object. Mapping the directory to properties.
app/controller/group/repository.js
=> target.group.repository
- Since:
- 1.0.0
- Source:
parse() → {Array}
Parse files from given directories, then return an items list, each item contains properties and exports.
For example, parse app/controller/group/repository.js
module.exports = app => {
return class RepositoryController extends app.Controller {};
}
It returns a item
{
properties: [ 'group', 'repository' ],
exports: app => { ... },
}
Properties
is an array that contains the directory of a filepath.
Exports
depends on type, if exports is a function, it will be called. if initializer is specified, it will be called with exports for customizing.
- Since:
- 1.0.0
- Source: