2019-01-03 02:21:25 +00:00
|
|
|
let fs = null;
|
|
|
|
let Filer = null;
|
|
|
|
|
|
|
|
module.exports = Filer = {
|
2014-05-23 18:14:06 +00:00
|
|
|
FileSystem: require('./filesystem/interface.js'),
|
2018-12-02 00:57:09 +00:00
|
|
|
Buffer: Buffer,
|
2019-01-03 02:21:25 +00:00
|
|
|
// We previously called this Path, but node calls it path. Do both
|
2014-05-23 18:14:06 +00:00
|
|
|
Path: require('./path.js'),
|
2019-01-03 02:21:25 +00:00
|
|
|
path: require('./path.js'),
|
2014-10-17 16:28:03 +00:00
|
|
|
Errors: require('./errors.js'),
|
|
|
|
Shell: require('./shell/shell.js')
|
2014-05-23 18:14:06 +00:00
|
|
|
};
|
2019-01-03 02:21:25 +00:00
|
|
|
|
|
|
|
// Add a getter for the `fs` instance, which returns
|
|
|
|
// a Filer FileSystem instance, using the default provider/flags.
|
|
|
|
Object.defineProperty(Filer, 'fs', {
|
|
|
|
enumerable: true,
|
|
|
|
get() {
|
|
|
|
if(!fs) {
|
|
|
|
fs = new Filer.FileSystem();
|
|
|
|
}
|
|
|
|
return fs;
|
|
|
|
}
|
|
|
|
});
|