Skip to content

Commit

Permalink
fs: undeprecate exists() and existsSync()
Browse files Browse the repository at this point in the history
fs.exists() and fs.existsSync() were deprecated in #103. This
commit removes the deprecation message, in order to stay more
in sync with joyent/node for the io.js 1.0.0 release.

Fixes: #257
PR-URL: #307
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Bert Belder <bertbelder@gmail.com>
  • Loading branch information
cjihrig committed Jan 12, 2015
1 parent 14dc917 commit 3a85eac
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,25 +217,25 @@ fs.accessSync = function(path, mode) {
binding.access(pathModule._makeLong(path), mode);
};

fs.exists = util.deprecate(function(path, callback) {
fs.exists = function(path, callback) {
if (!nullCheck(path, cb)) return;
var req = new FSReqWrap();
req.oncomplete = cb;
binding.stat(pathModule._makeLong(path), req);
function cb(err, stats) {
if (callback) callback(err ? false : true);
}
}, 'fs.exists() is deprecated. Use fs.access() instead.');
};

fs.existsSync = util.deprecate(function(path) {
fs.existsSync = function(path) {
try {
nullCheck(path);
binding.stat(pathModule._makeLong(path));
return true;
} catch (e) {
return false;
}
}, 'fs.existsSync() is deprecated. Use fs.accessSync() instead.');
};

fs.readFile = function(path, options, callback_) {
var callback = maybeCallback(arguments[arguments.length - 1]);
Expand Down

0 comments on commit 3a85eac

Please sign in to comment.