Module: node/config

Members

(static, constant) alias :Object

Option name aliases.

Type:
  • Object
Source:

Methods

(private, static) getFile(prefix, data) → {String}

Grab config file from data.

Parameters:
Name Type Description
prefix String
data Object
Source:
Returns:
Type
String

(private, static) getPrefix(data) → {String}

Grab prefix from data.

Parameters:
Name Type Description
data Object
Source:
Returns:
Type
String

(static) parse(options) → {Object}

Parse options and potentially env, args, and config.

Parameters:
Name Type Description
options Object
Source:
Returns:
Type
Object

(static) parseArg(argvnullable) → {Object}

Parse arguments.

Parameters:
Name Type Attributes Description
argv Array <nullable>
Source:
Returns:
Type
Object

(static) parseArgs(options) → {Object}

Parse env and args.

Parameters:
Name Type Description
options Object
Source:
Returns:
Type
Object

(static) parseAuth(text) → {Array:.<Buffer:>}

Parse authorized peers.

Parameters:
Name Type Description
text String
Source:
Returns:

keys

Type
Array:.<Buffer:>

(static) parseConfig(text) → {Object}

Parse config text.

Parameters:
Name Type Description
text String
Source:
Returns:
Type
Object

(static) parseEnv(env) → {Object}

Parse environment variables.

Parameters:
Name Type Description
env Object
Source:
Returns:
Type
Object

(static) parseForm(query) → {Object}

Parse form-urlencoded variables.

Parameters:
Name Type Description
query String
Source:
Returns:
Type
Object

(static) parseHash(hash) → {Object}

Parse uri hash variables.

Parameters:
Name Type Description
hash String
Source:
Returns:
Type
Object

(static) parseKnown(text) → {Object}

Parse known peers.

Parameters:
Name Type Description
text String
Source:
Returns:
Type
Object

(static) parseQuery(query) → {Object}

Parse uri querystring variables.

Parameters:
Name Type Description
query String
Source:
Returns:
Type
Object

(static) parseRaw(options) → {Object}

Parse env, args, and config.

Parameters:
Name Type Description
options Object
Source:
Returns:
Type
Object

(static) readAuth(file) → {Object}

Parse authorized peers file.

Parameters:
Name Type Description
file String
Source:
Returns:
Type
Object

(static) readConfig(file) → {Object}

Parse config file.

Parameters:
Name Type Description
file String
Source:
Returns:
Type
Object

(static) readKnown(file) → {Object}

Parse known peers file.

Parameters:
Name Type Description
file String
Source:
Returns:
Type
Object

(static) toOptions(data) → {Object}

Enforce types on parsed data.

Parameters:
Name Type Description
data Object
Source:
Returns:
Type
Object