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.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. # find-cache-dir [![Build Status](https://travis-ci.org/avajs/find-cache-dir.svg?branch=master)](https://travis-ci.org/avajs/find-cache-dir) [![Coverage Status](https://coveralls.io/repos/github/avajs/find-cache-dir/badge.svg?branch=master)](https://coveralls.io/github/avajs/find-cache-dir?branch=master)
  2. > Finds the common standard cache directory
  3. The [`nyc`](https://github.com/istanbuljs/nyc) and [`AVA`](https://ava.li) projects decided to standardize on a common directory structure for storing cache information:
  4. ```sh
  5. # nyc
  6. ./node_modules/.cache/nyc
  7. # ava
  8. ./node_modules/.cache/ava
  9. # your-module
  10. ./node_modules/.cache/your-module
  11. ```
  12. This module makes it easy to correctly locate the cache directory according to this shared spec. If this pattern becomes ubiquitous, clearing the cache for multiple dependencies becomes easy and consistent:
  13. ```
  14. rm -rf ./node_modules/.cache
  15. ```
  16. If you decide to adopt this pattern, please file a PR adding your name to the list of adopters below.
  17. ## Install
  18. ```
  19. $ npm install find-cache-dir
  20. ```
  21. ## Usage
  22. ```js
  23. const findCacheDir = require('find-cache-dir');
  24. findCacheDir({name: 'unicorns'});
  25. //=> '/user/path/node-modules/.cache/unicorns'
  26. ```
  27. ## API
  28. ### findCacheDir(options?)
  29. Finds the cache directory using the supplied options. The algorithm checks for the `CACHE_DIR` environmental variable and uses it if it is not set to `true`, `false`, `1` or `0`. If one is not found, it tries to find a `package.json` file, searching every parent directory of the `cwd` specified (or implied from other options). It returns a `string` containing the absolute path to the cache directory, or `undefined` if `package.json` was never found or if the `node_modules` directory is unwritable.
  30. #### options
  31. Type: `object`
  32. ##### name
  33. *Required*\
  34. Type: `string`
  35. Should be the same as your project name in `package.json`.
  36. ##### files
  37. Type: `string[] | string`
  38. An array of files that will be searched for a common parent directory. This common parent directory will be used in lieu of the `cwd` option below.
  39. ##### cwd
  40. Type: `string`\
  41. Default `process.cwd()`
  42. Directory to start searching for a `package.json` from.
  43. ##### create
  44. Type: `boolean`\
  45. Default `false`
  46. If `true`, the directory will be created synchronously before returning.
  47. ##### thunk
  48. Type: `boolean`\
  49. Default `false`
  50. If `true`, this modifies the return type to be a function that is a thunk for `path.join(theFoundCacheDirectory)`.
  51. ```js
  52. const thunk = findCacheDir({name: 'foo', thunk: true});
  53. thunk();
  54. //=> '/some/path/node_modules/.cache/foo'
  55. thunk('bar.js')
  56. //=> '/some/path/node_modules/.cache/foo/bar.js'
  57. thunk('baz', 'quz.js')
  58. //=> '/some/path/node_modules/.cache/foo/baz/quz.js'
  59. ```
  60. This is helpful for actually putting actual files in the cache!
  61. ## Tips
  62. - To test modules using `find-cache-dir`, set the `CACHE_DIR` environment variable to temporarily override the directory that is resolved.
  63. ## Adopters
  64. - [`AVA`](https://ava.li)
  65. - [`nyc`](https://github.com/istanbuljs/nyc)
  66. - [`Storybook`](https://storybook.js.org)
  67. - [`babel-loader`](https://github.com/babel/babel-loader)
  68. - [`eslint-loader`](https://github.com/MoOx/eslint-loader)
  69. - [`Phenomic`](https://phenomic.io)
  70. - [`javascripthon-loader`](https://github.com/Beg-in/javascripthon-loader)
  71. ---
  72. <div align="center">
  73. <b>
  74. <a href="https://tidelift.com/subscription/pkg/npm-find_cache-dir?utm_source=npm-find-cache-dir&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
  75. </b>
  76. <br>
  77. <sub>
  78. Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
  79. </sub>
  80. </div>