lib/configuration.js
function directives(def) {
  // mock line number for error messages
  var lineno = 1
    , k
    , v
    // inline directive, not from a file
    , file = 'directive override (argv)';

  function addDirective(k, v) {
    // must be strings split into an array
    // they are parsed and validated
    v = ('' + v).split(/\s+/);
    // mimic behaving as a child so source file
    // line numbers are not overwritten
    try {
      this.add(k, v, lineno, true);
    }catch(e) {
      return this.emit('error', new ConfigError(lineno, k + ' ' + v, file, e));
    }
    lineno++;
  }

  addDirective = addDirective.bind(this);

  for(k in def) {
    v = def[k];
    if(!Array.isArray(v)) {
      addDirective(k, v);
    }else{
      v.forEach(function(item) {
        addDirective(k, item);
      })
    }
  }
}
function directives(def) {
  // mock line number for error messages
  var lineno = 1
    , k
    , v
    // inline directive, not from a file
    , file = 'directive override (argv)';

  function addDirective(k, v) {
    // must be strings split into an array
    // they are parsed and validated
    v = ('' + v).split(/\s+/);
    // mimic behaving as a child so source file
    // line numbers are not overwritten
    try {
      this.add(k, v, lineno, true);
    }catch(e) {
      return this.emit('error', new ConfigError(lineno, k + ' ' + v, file, e));
    }
    lineno++;
  }

  addDirective = addDirective.bind(this);

  for(k in def) {
    v = def[k];
    if(!Array.isArray(v)) {
      addDirective(k, v);
    }else{
      v.forEach(function(item) {
        addDirective(k, item);
      })
    }
  }
}
function directives ( def ) { // mock line number for error messages var lineno = 1 , k , v // inline directive, not from a file , file = 'directive override (argv)' ; function addDirective ( k , v ) { // must be strings split into an array // they are parsed and validated v = ( '' + v ) . split ( / \s+ / ) ; // mimic behaving as a child so source file // line numbers are not overwritten try { this . add ( k , v , lineno , true ) ; } catch ( e ) { return this . emit ( 'error' , new ConfigError ( lineno , k + ' ' + v , file , e ) ) ; } lineno ++ ; } addDirective = addDirective . bind ( this ) ; for ( k in def ) { v = def [ k ] ; if ( ! Array . isArray ( v ) ) { addDirective ( k , v ) ; } else { v . forEach ( function ( item ) { addDirective ( k , item ) ; } ) } } }
Merge configuration directive overrides into this instance.

Should be invoked after the file and all includes have been loaded
and parsed.

@param def An object containing key value configuration pairs.
Merge configuration directive overrides into this instance .