Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface Options<YourConfiguration>

The options you can use to configure Confyglot.

Type parameters

  • YourConfiguration: Record<string, unknown> = Record<string, unknown>

Hierarchy

  • Options

Index

Properties

configPrefix

configPrefix: string

The filename without extension that Confyglot should use to find configuration files.

Confyglot adds the enabled format file extensions to this prefix to search a directory for configuration files.

Optional defaults

defaults: undefined | YourConfiguration

The default values of your configuration to use. Loaded configurations can override property by property.

When no configuration files could be loaded, Confyglot.load() returns this object or undefined if this option is undefined.

forbidMixedArrays

forbidMixedArrays: boolean

TOML does not allow mixed-type arrays. Set to true to enforce this behavior across all configuration formats.

fs

The fs to use. Enables Confyglot to be used in mocks and unit tests. By default, this is the built-in fs.promises.

normalize

normalize: boolean

Whether to normalize the configuration across possible formats.

Various formats have varying support for data types like integer, float, date, array, etc. With normalize, Confyglot makes a best effort to have consistent output regardless of which format was used.

Optional schema

schema: undefined | boolean | SchemaObject | AsyncSchema | JSONSchemaType<YourConfiguration, false>

A JSON schema for your configuration type. Confyglot uses Ajv to validate each loaded configuration.

transformNullStringToNull

transformNullStringToNull: boolean

TOML does not support null. Set this to true to have Confyglot convert any strings that exactly match "null" to the proper JS null value, null.

Generated using TypeDoc