Documentation
    Preparing search index...

    Interface BaseOptions<Schema>

    interface BaseOptions<Schema extends StandardSchemaV1> {
        accessPropertiesByDotNotation?: boolean;
        clearInvalidConfig?: boolean;
        configFileMode?: number;
        configName?: string;
        cwd?: string;
        deserialize?: Deserialize;
        fileExtension?: string;
        lock?: boolean | LockOptions;
        projectName?: string;
        projectSuffix?: string;
        schema?: Schema;
        serialize?: Serialize;
        watch?: boolean;
    }

    Type Parameters

    • Schema extends StandardSchemaV1
    Index
    accessPropertiesByDotNotation?: boolean

    Access nested properties using dot notation.

    true
    
    clearInvalidConfig?: boolean

    Read an empty config when the file cannot be deserialized or fails schema validation, instead of throwing a ConfError. The next write copies the invalid file to <name>.invalid-<timestamp>.<ext> next to it, then replaces it. File system errors are still thrown.

    false
    
    configFileMode?: number

    File mode used when creating the config file.

    0o600
    
    configName?: string

    Config file name without extension.

    'config'
    
    cwd?: string

    Directory where the config file is stored. Overrides projectName.

    deserialize?: Deserialize

    Custom deserializer. Defaults to extended JSON via parse.

    fileExtension?: string

    Config file extension without a leading dot.

    'json'
    
    lock?: boolean | LockOptions

    Hold an exclusive lock file (<path>.lock) while reading, changing and writing the config, so concurrent processes don't lose each other's writes. Reads never lock.

    false
    
    projectName?: string

    Project name used to resolve the default config directory. Required unless cwd is set.

    projectSuffix?: string

    Suffix appended to projectName in the config path.

    'nodejs'
    
    schema?: Schema

    Standard Schema used to validate the full config object.

    serialize?: Serialize

    Custom serializer. Defaults to extended JSON via stringify.

    watch?: boolean

    Watch the config file for external changes. Creates an empty config file when there is none, as the watcher needs a target.

    false