Dieses Repository beinhaltet HTML- und Javascript Code zur einer NotizenWebApp auf Basis von Web Storage. Zudem sind Mocha/Chai Tests im Browser enthalten. https://meinenotizen.netlify.app/
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 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. # locate-path [![Build Status](https://travis-ci.org/sindresorhus/locate-path.svg?branch=master)](https://travis-ci.org/sindresorhus/locate-path)
  2. > Get the first path that exists on disk of multiple paths
  3. ## Install
  4. ```
  5. $ npm install locate-path
  6. ```
  7. ## Usage
  8. Here we find the first file that exists on disk, in array order.
  9. ```js
  10. const locatePath = require('locate-path');
  11. const files = [
  12. 'unicorn.png',
  13. 'rainbow.png', // Only this one actually exists on disk
  14. 'pony.png'
  15. ];
  16. (async () => {
  17. console(await locatePath(files));
  18. //=> 'rainbow'
  19. })();
  20. ```
  21. ## API
  22. ### locatePath(input, [options])
  23. Returns a `Promise` for the first path that exists or `undefined` if none exists.
  24. #### input
  25. Type: `Iterable<string>`
  26. Paths to check.
  27. #### options
  28. Type: `Object`
  29. ##### concurrency
  30. Type: `number`<br>
  31. Default: `Infinity`<br>
  32. Minimum: `1`
  33. Number of concurrently pending promises.
  34. ##### preserveOrder
  35. Type: `boolean`<br>
  36. Default: `true`
  37. Preserve `input` order when searching.
  38. Disable this to improve performance if you don't care about the order.
  39. ##### cwd
  40. Type: `string`<br>
  41. Default: `process.cwd()`
  42. Current working directory.
  43. ### locatePath.sync(input, [options])
  44. Returns the first path that exists or `undefined` if none exists.
  45. #### input
  46. Type: `Iterable<string>`
  47. Paths to check.
  48. #### options
  49. Type: `Object`
  50. ##### cwd
  51. Same as above.
  52. ## Related
  53. - [path-exists](https://github.com/sindresorhus/path-exists) - Check if a path exists
  54. ## License
  55. MIT © [Sindre Sorhus](https://sindresorhus.com)