config
- Description:
-
-
Object which has function to read files related to config.
-
- Source:
Properties:
Name | Type | Description |
---|---|---|
plugins_installed |
function |
Function to read and pass data of installed plugins in config file. See bim.config.plugins_installed for more details |
Methods
(static) plugins_installed(file, callback)
- Description:
-
-
Function to read config file and run callback function with read data. File must have ".json" extension.
-
- Source:
Example
bim.config.plugins_installed('plugins', function (loaded) {
if (!loaded.error) {
try {
let json = JSON.parse(loaded.data);
let tempJson = JSON.stringfy(json[0]);
let keys = Object.keys(json[0]);
// Do Something ...
} catch (e) {
// Do Something ...
}
} else {
// Do Something ...
}
});
Parameters:
Name | Type | Description |
---|---|---|
file |
string |
File Name of ".json". Must be sent without an extension. |
callback |
function |
Callback Function. Called with below parameter in Object type. { error: {boolean}, data: {string}, message: {Error} } |