[minor] Use fs.exists
when available
`path.exists*` was moved to `fs` module in joyent/node@e10ed097cb.
This commit is contained in:
parent
1f67d35305
commit
87b0dd01c9
1 changed files with 2 additions and 1 deletions
|
@ -10,6 +10,7 @@ var fs = require('fs'),
|
|||
util = require('util'),
|
||||
formats = require('../formats'),
|
||||
Memory = require('./memory').Memory,
|
||||
exists = fs.exists || path.exists,
|
||||
existsSync = fs.existsSync || path.existsSync;
|
||||
|
||||
//
|
||||
|
@ -82,7 +83,7 @@ File.prototype.saveSync = function (value) {
|
|||
File.prototype.load = function (callback) {
|
||||
var self = this;
|
||||
|
||||
path.exists(self.file, function (exists) {
|
||||
exists(self.file, function (exists) {
|
||||
if (!exists) {
|
||||
return callback(null, {});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue