Permalink
Browse files

Add node v0.6 support

  • Loading branch information...
1 parent a321e4a commit d6503b6b6f5cb9df877de0e571d83e947fb3bebd @ForbesLindesay committed Aug 27, 2012
Showing with 8 additions and 2 deletions.
  1. +8 −2 lib/fs.js
View
@@ -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);
- });
+ }
});
}

0 comments on commit d6503b6

Please sign in to comment.