2019-11-15 23:20:34 +08:00
|
|
|
'use strict'
|
|
|
|
|
2020-03-23 17:00:06 +08:00
|
|
|
module.exports = {
|
2019-11-15 23:20:34 +08:00
|
|
|
// Export promiseified graceful-fs:
|
2020-03-23 17:00:06 +08:00
|
|
|
...require('./fs'),
|
2019-11-15 23:20:34 +08:00
|
|
|
// Export extra methods:
|
2020-03-23 17:00:06 +08:00
|
|
|
...require('./copy-sync'),
|
|
|
|
...require('./copy'),
|
|
|
|
...require('./empty'),
|
|
|
|
...require('./ensure'),
|
|
|
|
...require('./json'),
|
|
|
|
...require('./mkdirs'),
|
|
|
|
...require('./move-sync'),
|
|
|
|
...require('./move'),
|
|
|
|
...require('./output'),
|
|
|
|
...require('./path-exists'),
|
|
|
|
...require('./remove')
|
|
|
|
}
|
2019-11-15 23:20:34 +08:00
|
|
|
|
|
|
|
// Export fs.promises as a getter property so that we don't trigger
|
|
|
|
// ExperimentalWarning before fs.promises is actually accessed.
|
|
|
|
const fs = require('fs')
|
|
|
|
if (Object.getOwnPropertyDescriptor(fs, 'promises')) {
|
|
|
|
Object.defineProperty(module.exports, 'promises', {
|
|
|
|
get () { return fs.promises }
|
|
|
|
})
|
|
|
|
}
|