API Docs for: 0.0.1
Show:

Config Class

Defined in: lib/config.js:34
Module: niviz

A serializable JSON configuration that may be persisted in the local storage. A Config object is a collection of Setting objects.

Constructor

Config

(
  • [name='']
  • [settings]
  • [display_name='']
)

Defined in lib/config.js:34

Parameters:

  • [name=''] String optional

    The configuration's name.

  • [settings] Array optional

    The initial list of settings.

  • [display_name=''] String optional

    The configurations display name.

Item Index

Properties

Methods

add

(
  • settings
)
chainable

Defined in lib/config.js:89

Add settings to the configuration.

Parameters:

  • settings Array

    get

    (
    • name
    )
    Object | String | Array

    Defined in lib/config.js:118

    Retrieve sepecific setting from config.

    Parameters:

    • name String

      The name of the setting to retrieve

    Returns:

    Object | String | Array:

    Return specific setting

    load

    () chainable

    Defined in lib/config.js:159

    Load the config from the local storage.

    merge

    (
    • values
    )
    chainable

    Defined in lib/config.js:175

    Take a JSON object and merge its properties into the config.

    Parameters:

    set

    (
    • name
    • value
    )
    chainable

    Defined in lib/config.js:130

    Set a specific setting in this config.

    Parameters:

    • name String

      The name of the setting to set

    • value Object | String | Array

      The value of the setting

      store

      () chainable

      Defined in lib/config.js:148

      Store the config in the local storage.

      Properties

      id

      String

      Defined in lib/config.js:66

      The config id to use for the local storage.

      namespace

      String static

      Defined in lib/config.js:56

      The namespace for niviz configurations within the local storage.

      values

      Object

      Defined in lib/config.js:77

      The config values as an Object with a property for each setting.