Skip to content
Browse files

Fix deprecation warning on v0.7.x

  • Loading branch information...
1 parent a73e7aa commit 4d43130415d84c7acefb2573df7129ddea902bd7 @TooTallNate TooTallNate committed Apr 19, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/package.js
View
5 lib/package.js
@@ -10,6 +10,7 @@
*/
var fs = require('fs');
var path = require('path');
+var exists = fs.existsSync || path.existsSync;
/**
* Package.
@@ -45,7 +46,7 @@ package.discover = function(module) {
var found = null;
while (!found) {
- if (path.existsSync(location + '/package.json')) {
+ if (exists(location + '/package.json')) {
found = location;
} else if (location !== '/') {
location = path.dirname(location);
@@ -60,4 +61,4 @@ package.discover = function(module) {
/**
* Exporting the lib.
*/
-module.exports = package;
+module.exports = package;

0 comments on commit 4d43130

Please sign in to comment.
Something went wrong with that request. Please try again.