/**
 * @author Toru Nagashima
 * @copyright 2015 Toru Nagashima. All rights reserved.
 * See LICENSE file in root directory for full license.
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

var path = require("path");
var debug = require("debug")("eslint-plugin-node");
var exists = require("./exists");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

var cache = Object.create(null);

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/**
 * Gets a `package.json` data.
 * The data is cached if found, then it's used after.
 *
 * @param {string} startPath - A file path to lookup.
 * @returns {object|null} A found `package.json` data or `null`.
 *      This object have additional property `filePath`.
 */
module.exports = function getPackageJson(startPath) {
    var startDir = path.dirname(startPath);
    var dir = startDir;
    var prevDir;
    do {
        if (typeof cache[dir] !== "undefined") {
            debug("CACHE HIT", dir);
            return (cache[startDir] = cache[dir]);
        }

        var foundPath = path.join(dir, "package.json");
        if (exists(foundPath)) {
            debug("FOUND", foundPath);

            var data = require(foundPath);
            data.filePath = foundPath;
            return (cache[dir] = cache[startDir] = data);
        }
        debug("NOT FOUND", foundPath);

        // Go to next.
        prevDir = dir;
        dir = path.resolve(dir, "..");
    }
    while (dir !== prevDir);

    debug("NOT FOUND", "\"package.json\"");
    cache[startDir] = null;
    return null;
};

@@ -366,60 +366,8 @@
 %22);%0A
-var debug = require(%22debug%22)(%22eslint-plugin-node%22);%0A
 var 
@@ -1260,45 +1260,8 @@
 ) %7B%0A
-            debug(%22CACHE HIT%22, dir);%0A
     
@@ -1307,16 +1307,16 @@
 %5Bdir%5D);%0A
+
         
@@ -1411,48 +1411,8 @@
 ) %7B%0A
-            debug(%22FOUND%22, foundPath);%0A%0A
     
@@ -1560,47 +1560,8 @@
    %7D
-%0A        debug(%22NOT FOUND%22, foundPath);
 %0A%0A  
@@ -1683,52 +1683,8 @@
 );%0A%0A
-    debug(%22NOT FOUND%22, %22%5C%22package.json%5C%22%22);%0A
     

Remove require("debug")