lib/configuration.js
function writeLines() {
    var chunk = lines.slice(i * size, (i * size) + size);

    // all done
    if(!chunk.length) {
      return encoder.end();
    }

    // ensure we get correct line break between
    // line chunks, the encoder joins lines on EOL
    // this means that the last line in the chunk array
    // does not have an EOL, we need to ensure it does
    if(i > 0) {
      chunk.unshift('');
    }

    // write out the line chunk
    encoder.write(chunk);
    setImmediate(writeLines);
    i++;
  }
function writeLines() {
    var chunk = lines.slice(i * size, (i * size) + size);

    // all done
    if(!chunk.length) {
      return encoder.end();
    }

    // ensure we get correct line break between
    // line chunks, the encoder joins lines on EOL
    // this means that the last line in the chunk array
    // does not have an EOL, we need to ensure it does
    if(i > 0) {
      chunk.unshift('');
    }

    // write out the line chunk
    encoder.write(chunk);
    setImmediate(writeLines);
    i++;
  }
function writeLines ( ) { var chunk = lines . slice ( i * size , ( i * size ) + size ) ; // all done if ( ! chunk . length ) { return encoder . end ( ) ; } // ensure we get correct line break between // line chunks, the encoder joins lines on EOL // this means that the last line in the chunk array // does not have an EOL, we need to ensure it does if ( i > 0 ) { chunk . unshift ( '' ) ; } // write out the line chunk encoder . write ( chunk ) ; setImmediate ( writeLines ) ; i ++ ; }
split the work for larger config files
split the work for larger config files