You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
719 B
28 lines
719 B
2 years ago
|
'use strict'
|
||
|
|
||
|
module.exports = {
|
||
|
// Export promiseified graceful-fs:
|
||
|
...require('./fs'),
|
||
|
// Export extra methods:
|
||
|
...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')
|
||
|
}
|
||
|
|
||
|
// 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 }
|
||
|
})
|
||
|
}
|