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.

readme.md 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. # make-dir [![Build Status](https://travis-ci.org/sindresorhus/make-dir.svg?branch=master)](https://travis-ci.org/sindresorhus/make-dir) [![codecov](https://codecov.io/gh/sindresorhus/make-dir/branch/master/graph/badge.svg)](https://codecov.io/gh/sindresorhus/make-dir)
  2. > Make a directory and its parents if needed - Think `mkdir -p`
  3. ## Advantages over [`mkdirp`](https://github.com/substack/node-mkdirp)
  4. - Promise API *(Async/await ready!)*
  5. - Fixes many `mkdirp` issues: [#96](https://github.com/substack/node-mkdirp/pull/96) [#70](https://github.com/substack/node-mkdirp/issues/70) [#66](https://github.com/substack/node-mkdirp/issues/66)
  6. - 100% test coverage
  7. - CI-tested on macOS, Linux, and Windows
  8. - Actively maintained
  9. - Doesn't bundle a CLI
  10. - Uses the native `fs.mkdir/mkdirSync` [`recursive` option](https://nodejs.org/dist/latest/docs/api/fs.html#fs_fs_mkdir_path_options_callback) in Node.js >=10.12.0 unless [overridden](#fs)
  11. ## Install
  12. ```
  13. $ npm install make-dir
  14. ```
  15. ## Usage
  16. ```
  17. $ pwd
  18. /Users/sindresorhus/fun
  19. $ tree
  20. .
  21. ```
  22. ```js
  23. const makeDir = require('make-dir');
  24. (async () => {
  25. const path = await makeDir('unicorn/rainbow/cake');
  26. console.log(path);
  27. //=> '/Users/sindresorhus/fun/unicorn/rainbow/cake'
  28. })();
  29. ```
  30. ```
  31. $ tree
  32. .
  33. └── unicorn
  34. └── rainbow
  35. └── cake
  36. ```
  37. Multiple directories:
  38. ```js
  39. const makeDir = require('make-dir');
  40. (async () => {
  41. const paths = await Promise.all([
  42. makeDir('unicorn/rainbow'),
  43. makeDir('foo/bar')
  44. ]);
  45. console.log(paths);
  46. /*
  47. [
  48. '/Users/sindresorhus/fun/unicorn/rainbow',
  49. '/Users/sindresorhus/fun/foo/bar'
  50. ]
  51. */
  52. })();
  53. ```
  54. ## API
  55. ### makeDir(path, options?)
  56. Returns a `Promise` for the path to the created directory.
  57. ### makeDir.sync(path, options?)
  58. Returns the path to the created directory.
  59. #### path
  60. Type: `string`
  61. Directory to create.
  62. #### options
  63. Type: `object`
  64. ##### mode
  65. Type: `integer`\
  66. Default: `0o777`
  67. Directory [permissions](https://x-team.com/blog/file-system-permissions-umask-node-js/).
  68. ##### fs
  69. Type: `object`\
  70. Default: `require('fs')`
  71. Use a custom `fs` implementation. For example [`graceful-fs`](https://github.com/isaacs/node-graceful-fs).
  72. Using a custom `fs` implementation will block the use of the native `recursive` option if `fs.mkdir` or `fs.mkdirSync` is not the native function.
  73. ## Related
  74. - [make-dir-cli](https://github.com/sindresorhus/make-dir-cli) - CLI for this module
  75. - [del](https://github.com/sindresorhus/del) - Delete files and directories
  76. - [globby](https://github.com/sindresorhus/globby) - User-friendly glob matching
  77. - [cpy](https://github.com/sindresorhus/cpy) - Copy files
  78. - [cpy-cli](https://github.com/sindresorhus/cpy-cli) - Copy files on the command-line
  79. - [move-file](https://github.com/sindresorhus/move-file) - Move a file
  80. ---
  81. <div align="center">
  82. <b>
  83. <a href="https://tidelift.com/subscription/pkg/npm-make-dir?utm_source=npm-make-dir&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
  84. </b>
  85. <br>
  86. <sub>
  87. Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
  88. </sub>
  89. </div>