Optional config: string | JsonObjectPrivate Readonly _cfgPrivate Readonly _sectionPrivate Readonly _valueStatic Private Readonly _fileused by ExpiringFileLock to set the number of milliseconds to hold a lock
10000
used by ExpiringFileLock to set the number of milliseconds to wait for a lock to become available
10000
used by FileSystemMap to set the directory where the data is written to the file system
'FileSystemMap'
used by AftLogger to limit console output by importance
'warn'
an array of plugin filenames (these must also match the lowercase plugin class name minus
any -, _ and . characters) to load via the pluginLoader
ex:
// aftconfig.json
{
"plugins": [
"my-plugin",
{"name": "my-other-plugin", "searchDir": "/full/path/to/my-other-plugin/"}
]
}
would match with the following plugin classes
// <project-root>/any/subdirectory/my-plugin.js
export class MyPlugin extends Plugin {
doStuff = () => 'stuff';
}
and
// /full/path/to/my-other-plugin.js
export class MyOtherPlugin extends Plugin {
doOtherStuff = () => 'other stuff';
}
[]
Private _loadlooks for a value in the aftconfig.json file at the top level and if found attempts
to extract any environment variable set if the value matches a format of %some_var_name%
before returning the value or the specified defaultVal if nothing was found
the configuration key
Optional defaultVal: Ta default value to return if no value is set for the specified key
the value set in the aftconfig.json file for the specified key or undefined
looks for a top-level section in your aftconfig.json file with a name matching the passed in
className and returns it or a new instance of the className type
a class of type T where the name of the class and the section name must match
the section from aftconfig.json matching the name of the passed in className or a
new instance of the className type
attempts to get an environment variable value for a given key if the passed
in input is in the format of %some_env_var_key%
a string that might reference an environment var between two %
characters like %some_env_var%
the value of the environment variable
iterates over all properties for the passed in input object and
if a property is a string it calls processEnvVars on the property
an object that contains properties
the input object with any string property values updated
based on the result of calling processEnvVars
adds the passed in section to the ConfigManager cache of aftconfig.json
sections so it will be used instead of the value from the actual JSON file
adds the passed in section to the cache so it will be used
instead of reading from aftconfig.json
an object containing properties
Generated using TypeDoc
class providing configuration used by AFT and it's plugins for reading in configuration an
aftconfig.json,aftconfig.js,aftconfig.cjsoraftconfig.mjsfile at the project root. this configuration can be read as a top-level field usingaftConfig.get('field_name')oraftConfig.get('field_name', defaultVal)and can also be set without actually modifying the values in youraftconfig.jsonusingaftConfig.set('field_name', val). additionally, configuration classes can be read usingAftConfigwith theaftConfig.getSection(ConfigClass)which will read from youraftconfig.jsonfile for a field namedConfigClassNOTE:
Ex: with an
aftconfig.jsoncontaining:and with the following environment variables set:
and a config class of:
can be accessed using an
AftConfiginstance as follows:and if you wish to entirely disregard the configuration specified in your
aftconfig.jsonfile you can use the following (still based on the above example):