ModuleParser
ModuleParser
new ModuleParser()
The ModuleParser is a utility class designed to loop through and iterate
on a directory and pull out of each .js file found, any classes or exports
that extend from GQLBase or a child of GQLBase.
- Since:
- 2.7.0
- Source:
- ModuleParser.js, line 74
Methods
(static) ModuleParser()
A string denoting the directory on disk where ModuleParser
should be
searching for its classes.
- Source:
- ModuleParser.js, line 105
⌾⠀importClass(filePath) → {Object}
Given a file path, this method will attempt to import/require the
file in question and return the object it exported; whatever that
may be.
Parameters:
Name | Type | Description |
---|---|---|
filePath |
string | a path to pass to |
Returns:
(
Object
)
the object, or undefined, that was returned when
it was require()
'ed.
- Since:
- 2.7.0
- Source:
- ModuleParser.js, line 118
(async, inner) walk(dir, filelist) → {Promise.<Array.<string>>}
Recursively walks a directory and returns an array of asbolute file paths
to the files under the specified directory.
Parameters:
Name | Type | Description |
---|---|---|
dir |
string | string path to the top level directory to parse |
filelist |
Array.<string> | an array of existing absolute file paths, |
Returns:
(
Promise.<Array.<string>>
)
an array of existing absolute file paths
found under the supplied dir
directory.
- Since:
- 2.7.0
- Source:
- ModuleParser.js, line 386
(inner) ⎆⠀constructor(directory)
The constructor
Parameters:
Name | Type | Description |
---|---|---|
directory |
string | a string path to a directory containing the |
- Source:
- ModuleParser.js, line 85