Skip to content

Commit e057bfc

Browse files
committed
[example] Avoid using deprecated APIs
1 parent 4a605b9 commit e057bfc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/fileapi/server.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ function makePathForFile (filePath, prefix, cb) {
3434
if (error) return cb(error);
3535
if (pieces.length === 0) return cb(null, incrementalPath);
3636
incrementalPath += '/' + pieces.shift();
37-
fs.exists(incrementalPath, function (exists) {
38-
if (!exists) fs.mkdir(incrementalPath, step);
37+
fs.access(incrementalPath, function (err) {
38+
if (err) fs.mkdir(incrementalPath, step);
3939
else process.nextTick(step);
4040
});
4141
}

0 commit comments

Comments
 (0)