determine if fs.existSync exists, else use path #14

Closed
wants to merge 2 commits into
from
View
@@ -17,7 +17,8 @@ exports.sync = function (x, opts) {
if (!opts) opts = {};
var isFile = opts.isFile || function (file) {
- return path.existsSync(file) && fs.statSync(file).isFile()
+ var obj = fs.existsSync ? fs : path;
+ return obj.existsSync(file) && fs.statSync(file).isFile()
};
var readFileSync = opts.readFileSync || fs.readFileSync;