lib/configuration.js
function Configuration(options, parent) {
  options = options || {};
  this.options = options;

  // delimiter used to split and join lines
  this.options.eol = options.eol || EOL;

  // parent reference - used by includes
  this._parent = parent;

  // file path to primary configuration file loaded
  this._file = null;

  // encapsulates the decoded data
  this._data = {};

  // keep track of modified keys
  this._modified = {};

  // keep track of keys that were added that were
  // not present when the configuration file was parsed
  // this will be appended on rewrite
  this._added = {};

  // map of files that were included
  this._includes = {};

  // current include file being processed
  this._include = null;

  // store all lines for REWRITE
  this._lines = [];

  // only the root needs defaults
  if(!parent) {
    this.set(Types.PORT, DEFAULTS.port, null, true);
  }
}
function Configuration(options, parent) {
  options = options || {};
  this.options = options;

  // delimiter used to split and join lines
  this.options.eol = options.eol || EOL;

  // parent reference - used by includes
  this._parent = parent;

  // file path to primary configuration file loaded
  this._file = null;

  // encapsulates the decoded data
  this._data = {};

  // keep track of modified keys
  this._modified = {};

  // keep track of keys that were added that were
  // not present when the configuration file was parsed
  // this will be appended on rewrite
  this._added = {};

  // map of files that were included
  this._includes = {};

  // current include file being processed
  this._include = null;

  // store all lines for REWRITE
  this._lines = [];

  // only the root needs defaults
  if(!parent) {
    this.set(Types.PORT, DEFAULTS.port, null, true);
  }
}
function Configuration ( options , parent ) { options = options || { } ; this . options = options ; // delimiter used to split and join lines this . options . eol = options . eol || EOL ; // parent reference - used by includes this . _parent = parent ; // file path to primary configuration file loaded this . _file = null ; // encapsulates the decoded data this . _data = { } ; // keep track of modified keys this . _modified = { } ; // keep track of keys that were added that were // not present when the configuration file was parsed // this will be appended on rewrite this . _added = { } ; // map of files that were included this . _includes = { } ; // current include file being processed this . _include = null ; // store all lines for REWRITE this . _lines = [ ] ; // only the root needs defaults if ( ! parent ) { this . set ( Types . PORT , DEFAULTS . port , null , true ) ; } }
Encapsulates a configuration file.

Fields are exposed on this instance as public properties
for easy read access, however writing should be performed using
the set() method to ensure the document knows which config parameters
have been changed.

@param options Configuration options.
@param parent A parent configuration.
Encapsulates a configuration file .