Comparing version 0.0.3 to 0.0.4
{ | ||
"name": "witwip", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"description": "Where in the world is package.json?", | ||
@@ -20,3 +20,6 @@ "main": "witwip.js", | ||
"author": "Brian Link", | ||
"license": "MIT" | ||
"license": "MIT", | ||
"engines": { | ||
"node": ">= 0.6.0" | ||
} | ||
} |
var path = require('path'), | ||
fs = require('fs'), | ||
existsSync = fs.existsSync ? fs.existsSync : path.existsSync, | ||
modulePathCache = {}; | ||
@@ -32,3 +33,3 @@ | ||
newPath = path.resolve(base, 'package.json'); | ||
if (fs.existsSync(newPath)) { | ||
if (existsSync(newPath)) { | ||
newPath = fs.realpathSync(newPath); | ||
@@ -44,3 +45,3 @@ cache[modulePath] = newPath; | ||
newPath = path.resolve(base, modulePath, 'package.json'); | ||
if (fs.existsSync(newPath)) { | ||
if (existsSync(newPath)) { | ||
newPath = fs.realpathSync(newPath); | ||
@@ -55,3 +56,3 @@ cache[modulePath] = newPath; | ||
newPath = path.resolve(base, 'node_modules', modulePath, 'package.json'); | ||
if (fs.existsSync(newPath)) { | ||
if (existsSync(newPath)) { | ||
newPath = fs.realpathSync(newPath); | ||
@@ -58,0 +59,0 @@ cache[modulePath] = newPath; |
7090
96