index.js 719 B

123456789101112131415161718192021222324252627
  1. 'use strict'
  2. module.exports = {
  3. // Export promiseified graceful-fs:
  4. ...require('./fs'),
  5. // Export extra methods:
  6. ...require('./copy-sync'),
  7. ...require('./copy'),
  8. ...require('./empty'),
  9. ...require('./ensure'),
  10. ...require('./json'),
  11. ...require('./mkdirs'),
  12. ...require('./move-sync'),
  13. ...require('./move'),
  14. ...require('./output'),
  15. ...require('./path-exists'),
  16. ...require('./remove')
  17. }
  18. // Export fs.promises as a getter property so that we don't trigger
  19. // ExperimentalWarning before fs.promises is actually accessed.
  20. const fs = require('fs')
  21. if (Object.getOwnPropertyDescriptor(fs, 'promises')) {
  22. Object.defineProperty(module.exports, 'promises', {
  23. get () { return fs.promises }
  24. })
  25. }