Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
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.

fs-promises.js 726B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. 'use strict'
  2. const fs = require('fs')
  3. const { promisify } = require('util')
  4. module.exports = { ...fs }
  5. // Promisify all functions for consistency
  6. const fns = [
  7. 'access',
  8. 'appendFile',
  9. 'chmod',
  10. 'chown',
  11. 'close',
  12. 'copyFile',
  13. 'fchmod',
  14. 'fchown',
  15. 'fdatasync',
  16. 'fstat',
  17. 'fsync',
  18. 'ftruncate',
  19. 'futimes',
  20. 'lchmod',
  21. 'lchown',
  22. 'link',
  23. 'lstat',
  24. 'mkdir',
  25. 'mkdtemp',
  26. 'open',
  27. 'read',
  28. 'readdir',
  29. 'readFile',
  30. 'readlink',
  31. 'realpath',
  32. 'rename',
  33. 'rmdir',
  34. 'stat',
  35. 'symlink',
  36. 'truncate',
  37. 'unlink',
  38. 'utimes',
  39. 'write',
  40. 'writeFile'
  41. ]
  42. fns.forEach(fn => {
  43. /* istanbul ignore else: all functions exist on OSX */
  44. if (fs[fn]) {
  45. module.exports[fn] = promisify(fs[fn])
  46. }
  47. })