var path = require('path')
  , fs = require('fs')
  , clone = require('clone')
  , getset = require('deep-get-set')
  , DeepMerge = require('deep-merge')
  , merge = DeepMerge(function(a, b) {
      return b
    });

getset.p = true;


function Settings() {
  this._obj = {};
  this._formats = {};
}

Settings.prototype.get = function(path) {
  path = path.replace(/\//g, '.');
  return clone(getset(this._obj, path));
}

Settings.prototype.set = function(path, val) {
  path = path.replace(/\//g, '.');
  getset(this._obj, path, val);
  return this;
}

Settings.prototype.load = function(file) {
  var ext = path.extname(file);
  
  var parse = this._formats[ext];
  if (!parse) { throw new Error('Unable to load configuration files with extension: ' + ext); }
  
  var data = fs.readFileSync(file, 'utf8');
  var obj = parse(data);
  if (obj) {
    this._obj = merge(this._obj, obj);
  }
  return this;
}

Settings.prototype.format = function(ext, parser) {
  if ('.' != ext[0]) { ext = '.' + ext; }
  this._formats[ext] = parser;
  return this;
}

Settings.prototype.toObject = function() {
  return clone(this._obj);
}


module.exports = Settings;

@@ -247,16 +247,19 @@
 ettings(
+obj
 ) %7B%0A  th
@@ -267,16 +267,23 @@
 s._obj =
+ obj %7C%7C
  %7B%7D;%0A  t
@@ -549,32 +549,230 @@
 return this;%0A%7D%0A%0A
+Settings.prototype.isolate = function(prefix) %7B%0A  if (prefix%5Bprefix.length - 1%5D == '/') %7B prefix = prefix.slice(0, prefix.length - 1); %7D%0A  var obj = this.get(prefix);%0A  return new Settings(obj);%0A%7D%0A%0A
 Settings.prototy

Add function to isolate settings to a prefix.