Home Manual Reference Source Test Repository
import Config from 'reptar/lib/config/index.js'
public class | source

Config

Constructor Summary

Public Constructor
public

constructor(root: *)

Member Summary

Public Members
public

Full path to where we're running our app from.

Method Summary

Public Methods
public

get(objectPath: [string]): *

Getter to access config properties.

public

update()

Update our in-memory representation of the config file from disk.

Public Constructors

public constructor(root: *) source

Params:

NameTypeAttributeDescription
root *
  • optional

Public Members

public root: string source

Full path to where we're running our app from.

Public Methods

public get(objectPath: [string]): * source

Getter to access config properties. Everything is pushed through here so we can provide required defaults if they're not set. Also enforces uniform access to config properties.

Params:

NameTypeAttributeDescription
objectPath [string]

Path to object property, i.e. 'path.source'. If it isn't given then you get the entire config object.

Return:

*

Config value.

public update() source

Update our in-memory representation of the config file from disk. This load's the YAML file, parses it, validates it, sets defaults, and then updates our internal instance.