Options
All
  • Public
  • Public/Protected
  • All
Menu

Module @kosko/config

Index

References

Config

Re-exports Config

EnvironmentConfig

Re-exports EnvironmentConfig

ValidationError

Re-exports ValidationError

getConfig

Re-exports getConfig

loadConfig

Re-exports loadConfig

searchConfig

Re-exports searchConfig

validate

Re-exports validate

Functions

getConfig

  • Returns environment configs merged with global configs.

    Parameters

    • config: Config

      Config object.

    • env: string

      Environment name.

    Returns Required<EnvironmentConfig>

loadConfig

  • loadConfig(path: string): Promise<Config>
  • Parses and validates a config file from the specified path.

    Parameters

    • path: string

      Path of the config file.

    Returns Promise<Config>

searchConfig

  • searchConfig(cwd?: string): Promise<Config>
  • Searchs config files in the specified directory. Returns an empty object when config files does not exist in the directory.

    Parameters

    • Default value cwd: string = process.cwd()

      Path to the working directory.

    Returns Promise<Config>

validate

  • validate(data: any): void
  • Validates data with kosko configuration schema. It throws a ValidationError when validation failed.

    Parameters

    • data: any

    Returns void

Generated using TypeDoc