Skip to content

Commit

Permalink
Add node v0.6 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Forbes Lindesay committed Aug 27, 2012
1 parent a321e4a commit d6503b6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/fs.js
@@ -1,13 +1,19 @@
var pathLib = require('path');
var fs = require('fs');
var Q = require('q');

// exists(path);
// => bool
module.exports.exists = function exists(path) {
return Q.ncall(function exists(cb) {
fs.exists(path, function (exists) {
if (fs.exists) {
fs.exists(path, then);
} else {
pathLib.exists(path, then)
}
function then(exists) {
cb(null, exists);
});
}
});
}

Expand Down

0 comments on commit d6503b6

Please sign in to comment.