معرفی شرکت ها


find-cache-dir-4.0.0


Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر
Card image cap
تبلیغات ما

مشتریان به طور فزاینده ای آنلاین هستند. تبلیغات می تواند به آنها کمک کند تا کسب و کار شما را پیدا کنند.

مشاهده بیشتر

توضیحات

Finds the common standard cache directory
ویژگی مقدار
سیستم عامل -
نام فایل find-cache-dir-4.0.0
نام find-cache-dir
نسخه کتابخانه 4.0.0
نگهدارنده ['sindresorhus']
ایمیل نگهدارنده ['sindresorhus@gmail.com']
نویسنده Sindre Sorhus
ایمیل نویسنده sindresorhus@gmail.com
آدرس صفحه اصلی git+https://github.com/sindresorhus/find-cache-dir.git
آدرس اینترنتی https://github.com/sindresorhus/find-cache-dir#readme
مجوز MIT
# find-cache-dir > Finds the common standard cache directory 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: ```sh # nyc ./node_modules/.cache/nyc # ava ./node_modules/.cache/ava # your-module ./node_modules/.cache/your-module ``` 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: ``` rm -rf ./node_modules/.cache ``` ## Install ```sh npm install find-cache-dir ``` ## Usage ```js import findCacheDirectory from 'find-cache-dir'; findCacheDirectory({name: 'unicorns'}); //=> '/user/path/node-modules/.cache/unicorns' ``` ## API ### findCacheDirectory(options?) 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. #### options Type: `object` ##### name *Required*\ Type: `string` Should be the same as your project name in `package.json`. ##### files Type: `string[] | string` 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. ##### cwd Type: `string`\ Default `process.cwd()` Directory to start searching for a `package.json` from. ##### create Type: `boolean`\ Default `false` If `true`, the directory will be created synchronously before returning. ##### thunk Type: `boolean`\ Default `false` If `true`, this modifies the return type to be a function that is a thunk for `path.join(theFoundCacheDirectory)`. ```js const thunk = findCacheDir({name: 'foo', thunk: true}); thunk(); //=> '/some/path/node_modules/.cache/foo' thunk('bar.js') //=> '/some/path/node_modules/.cache/foo/bar.js' thunk('baz', 'quz.js') //=> '/some/path/node_modules/.cache/foo/baz/quz.js' ``` This is helpful for actually putting actual files in the cache! ## Tips - To test modules using `find-cache-dir`, set the `CACHE_DIR` environment variable to temporarily override the directory that is resolved. ## Adopters - [`ava`](https://avajs.dev) - [`nyc`](https://github.com/istanbuljs/nyc) - [`storybook`](https://github.com/storybookjs/storybook) - [`babel-loader`](https://github.com/babel/babel-loader) - [`eslint-loader`](https://github.com/MoOx/eslint-loader) - [More…](https://www.npmjs.com/browse/depended/find-cache-dir)


نیازمندی

مقدار نام
^3.0.0 common-path-prefix
^7.0.0 pkg-dir


زبان مورد نیاز

مقدار نام
14.19.3 Npm


نحوه نصب


نصب پکیج tgz find-cache-dir-4.0.0:

    npm install find-cache-dir-4.0.0.tgz