- Source
Methods
(async, inner) createMethod(dir) → {number}
This function scan directory for .js
and .json
files, read its content, and turn it to become a class method by attach it to its scope (its class instance) dynamically.
File path is camel-cased and become the method name. File that starts with underscore (eg: _my-file.js
) is ignored; usefull to use such file as your shared library.
Parameters:
Name | Type | Description |
---|---|---|
dir | string | Directory to scan |
- Source
Returns:
Number of files found
- Type:
- number