API Docs for: 0.0.2
Show:

Dalek.Config Class

Defined in: index.js:51
Module: DalekJS

Parses config data & loads config files

Methods

_checkDefaultFile

(
  • ext
  • data
)
String private

Defined in index.js:107

Iterator function that checks the existance of a the default file

Parameters:

  • ext String

    File extension to check

  • data Object

    File data

Returns:

String:

config File path

_checkFile

(
  • previousValue
  • ext
  • idx
  • data
)
String private

Defined in index.js:82

Iterator function that checks the existance of a given file

Parameters:

  • previousValue String

    Last iterations result

  • ext String

    File extension to check

  • idx Integer

    Iteration index

  • data Object

    File data

Returns:

String:

config File path

_verify

(
  • check
  • fn
  • instance
)
Array private

Defined in index.js:260

Verifies if a driver is given, exists & is valid

Parameters:

  • check Array

    Data that shoudl be mapped

  • fn String

    Name of the function that should be invoked on the veryify object

  • instance Object

    Object instance where the verify function should be invoked

Returns:

Array:

data List of verified items

_verifyIterator

(
  • fn
  • instance
  • elm
)
String | Null

Defined in index.js:275

Verifies if a driver is given, exists & is valid

Parameters:

  • fn String

    Name of the function that should be invoked on the veryify object

  • instance Object

    Object instance where the verify function should be invoked

  • elm String

    Name of the element that should be checked

Returns:

String | Null:

element name of the verified element or false if checked failed

checkAvailabilityOfConfigFile

(
  • pathname
)
String

Defined in index.js:63

Checks if a config file is available

Parameters:

  • pathname String

Returns:

String:

config File path

get

(
  • item
)
Mixed | Null

Defined in index.js:168

Fetches & returns a config item

Parameters:

  • item String

    Key of the item to load

Returns:

Mixed | Null:

data Requested config data

load

(
  • defaults
  • pathname
  • opts
)
Object

Defined in index.js:128

Loads a file & merges the results with the commandline options & the default config

Parameters:

  • defaults Object

    Default config

  • pathname String

    Filename of the config file to load

  • opts Object

    Command line options

Returns:

Object:

config Merged config data

loadFile

(
  • pathname
)
Object

Defined in index.js:155

Loads a config file & parses it based on the file extension

Parameters:

  • pathname String

    Filename of the config file to load

Returns:

Object:

data Config data

readcoffee

() Object

Defined in index.js:227

Loads a coffescript config file

Returns:

Object:

data Parsed config data

readjs

() Object

Defined in index.js:216

Loads a javascript config file

Returns:

Object:

data Parsed config data

readjson

() Object

Defined in index.js:180

Loads a json config file

Returns:

Object:

data Parsed config data

readJson5

() Object

Defined in index.js:192

Loads a json5 config file

Returns:

Object:

data Parsed config data

readyaml

() Object

Defined in index.js:204

Loads a yaml config file

Returns:

Object:

data Parsed config data

verifyDrivers

() Array

Defined in index.js:249

Verifies if a driver is given, exists & is valid

Returns:

Array:

data List of verified drivers

verifyReporters

() Array

Defined in index.js:238

Verifies if a reporter is given, exists & is valid

Returns:

Array:

data List of verified reporters