code: function resolve (cwd) {
    var dirname = cwd ? process.cwd() : __dirname;
    var index = dirname.indexOf(deps);
    var parts = (~index ? dirname.slice(0, index) : dirname).split(sep);
    var root;
  
    while (parts.length) {
      root = parts.join(sep);
      if (fs.existsSync(path.join(root, 'package.json'))) break;
      parts.pop();
    }
  
    return root;
  }
docs: /*
  Module