Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FlexConf

FlexConf class, representing the entire config of the config folder

Hierarchy

  • FlexConf

Index

Constructors

constructor

  • Create a new configuration instance.

    Parameters

    • configFolder: string

      Path to the folder that holds all configuration files.

    • Default value options: IFlexConfOptions = {}

      FlexConf configuration options.

    Returns FlexConf

Properties

Private autoload

autoload: boolean

configFiles

configFiles: ConfigFile[]

Private configFolder

configFolder: string

Private folderTags

folderTags: boolean

Private loadRecursive

loadRecursive: boolean

Private lowerCase

lowerCase: boolean

Private parseArgv

parseArgv: boolean

Private parseEnv

parseEnv: boolean

Private parseValues

parseValues: boolean

Private postfix

postfix: string

Private separator

separator: string

store

store: Provider

Private tagDefinitions

tagDefinitions: object

Type declaration

Methods

final

  • final(): any

loadConfigFiles

  • loadConfigFiles(): void
  • Load all configuration files inside the root config folder and it's sub-folders if loadRecursive is activated.

    Returns void

saveToFile

  • saveToFile(namespace: string, options?: object): string
  • Save a config namespace to a file.

    Parameters

    • namespace: string

      Config namespace to save to a file.

    • Default value options: object = {}

      Options object.

      • Optional encoding?: string

        File encoding, default to 'utf8'.

      • Optional filepath?: string

        Path to save the config file to, defaults to '[os.tmpdir()]/[namespace].json'.

      • Optional flag?: string

        Write operation flags, defaults to 'w'.

      • Optional mode?: number

        File permissions, default to read-only for the owner (0o600).

      • Optional space?: string | number

        A String or Number object that's used to insert white space into the output JSON string for readability purposes.

    Returns string

    Path of the saved config file.