Linux unitednationsplay.com 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
nginx/1.20.1
Server IP : 188.130.139.92 & Your IP : 18.223.125.111
Domains :
Cant Read [ /etc/named.conf ]
User : web
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
home /
www /
unp_probe /
node_modules /
find-cache-dir /
Delete
Unzip
Name
Size
Permission
Date
Action
index.js
662
B
-rw-r--r--
2017-05-12 14:24
license
1.09
KB
-rw-r--r--
2017-05-12 13:58
package.json
1.73
KB
-rw-r--r--
2021-02-04 21:24
readme.md
2.83
KB
-rw-r--r--
2017-05-12 14:26
Save
Rename
# find-cache-dir [](https://travis-ci.org/avajs/find-cache-dir) [](https://coveralls.io/github/avajs/find-cache-dir?branch=master) > Finds the common standard cache directory Recently the [`nyc`](https://github.com/bcoe/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 ``` If you decide to adopt this pattern, please file a PR adding your name to the list of adopters below. ## Install ``` $ npm install --save find-cache-dir ``` ## Usage ```js const findCacheDir = require('find-cache-dir'); findCacheDir({name: 'unicorns'}); //=> '/user/path/node-modules/.cache/unicorns' ``` ## API ### findCacheDir([options]) Finds the cache directory using the supplied options. The algorithm 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 `null` if `package.json` was never found. #### options ##### name *Required*<br> Type: `string` Should be the same as your project name in `package.json`. ##### files Type: `Array` `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`<br> Default `process.cwd()` Directory to start searching for a `package.json` from. ##### create Type: `boolean`<br> Default `false` If `true`, the directory will be created synchronously before returning. ##### thunk Type: `boolean`<br> 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! ## Adopters - [`AVA`](https://ava.li) - [`nyc`](https://github.com/bcoe/nyc) - [`babel-loader`](https://github.com/babel/babel-loader) - [`eslint-loader`](https://github.com/MoOx/eslint-loader) - [`Phenomic`](https://phenomic.io) ## License MIT © [James Talmage](https://github.com/jamestalmage)