{"maintainers":[{"name":"jamestalmage","email":"james@talmage.io"},{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"keywords":["cache","directory","dir","caching","find","search"],"dist-tags":{"latest":"1.0.0"},"author":{"name":"James Talmage","email":"james@talmage.io","url":"github.com/jamestalmage"},"description":"My well-made module","readme":"# 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)\n\n> Finds the common standard cache directory\n\nRecently 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:\n\n```sh\n# nyc\n./node_modules/.cache/nyc\n\n# ava\n./node_modules/.cache/ava\n\n# your-module\n./node_modules/.cache/your-module\n```\n\nThis 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:\n\n```\nrm -rf ./node_modules/.cache\n```\n\nIf you decide to adopt this pattern, please file a PR adding your name to the list of adopters below.\n\n\n## Install\n\n```\n$ npm install --save find-cache-dir\n```\n\n\n## Usage\n\n```js\nconst findCacheDir = require('find-cache-dir');\n\nfindCacheDir({name: 'unicorns'});\n//=> '/user/path/node-modules/.cache/unicorns'\n```\n\n\n## API\n\n### findCacheDir([options])\n\nFinds 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.\n\n#### options\n\n##### name\n\n*Required*<br>\nType: `string`\n\nShould be the same as your project name in `package.json`.\n\n##### files\n\nType: `Array` `string\n\nAn 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.\n\n##### cwd\n\nType: `string`<br>\nDefault `process.cwd()`\n\nDirectory to start searching for a `package.json` from.\n\n##### create\n\nType: `boolean`<br>\nDefault `false`\n\nIf `true`, the directory will be created synchronously before returning.\n\n##### thunk\n\nType: `boolean`<br>\nDefault `false`\n\nIf `true`, this modifies the return type to be a function that is a thunk for `path.join(theFoundCacheDirectory)`.\n\n```js\nconst thunk = findCacheDir({name: 'foo', thunk: true});\n\nthunk();\n//=> '/some/path/node_modules/.cache/foo'\n\nthunk('bar.js')\n//=> '/some/path/node_modules/.cache/foo/bar.js'\n\nthunk('baz', 'quz.js')\n//=> '/some/path/node_modules/.cache/foo/baz/quz.js'\n```\n\nThis is helpful for actually putting actual files in the cache!\n\n\n## Adopters\n\n- [`AVA`](https://ava.li)\n- [`nyc`](https://github.com/bcoe/nyc)\n- [`babel-loader`](https://github.com/babel/babel-loader)\n- [`eslint-loader`](https://github.com/MoOx/eslint-loader)\n- [`Phenomic`](https://phenomic.io)\n\n\n## License\n\nMIT © [James Talmage](https://github.com/jamestalmage)\n","repository":{"type":"git","url":"git+https://github.com/avajs/find-cache-dir.git"},"users":{"wenbing":true},"bugs":{"url":"https://github.com/avajs/find-cache-dir/issues"},"license":"MIT","versions":{"0.1.0":{"name":"find-cache-dir","version":"0.1.0","description":"My well-made module","license":"MIT","repository":{"type":"git","url":"git+https://github.com/jamestalmage/find-cache-dir.git"},"author":{"name":"James Talmage","email":"james@talmage.io","url":"github.com/jamestalmage"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && nyc --reporter=lcov --reporter=text ava"},"files":["index.js"],"keywords":[],"dependencies":{"common-dir":"^0.1.4","commondir":"^1.0.1","mkdirp":"^0.5.1","pkg-dir":"^1.0.0"},"devDependencies":{"ava":"^0.8.0","coveralls":"^2.11.6","nyc":"^5.0.1","rimraf":"^2.5.0","xo":"^0.12.1"},"gitHead":"4f6179091b3562c68869a4228992b5e0791f4a17","bugs":{"url":"https://github.com/jamestalmage/find-cache-dir/issues"},"homepage":"https://github.com/jamestalmage/find-cache-dir#readme","_id":"find-cache-dir@0.1.0","_shasum":"7103acfca3abb52b02b0d2dc24a5c8611577c2d9","_from":".","_npmVersion":"3.5.2","_nodeVersion":"5.2.0","_npmUser":{"name":"jamestalmage","email":"james@talmage.io"},"dist":{"shasum":"7103acfca3abb52b02b0d2dc24a5c8611577c2d9","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/find-cache-dir/-/find-cache-dir-0.1.0.tgz"},"maintainers":[{"name":"jamestalmage","email":"james@talmage.io"}],"directories":{}},"0.1.1":{"name":"find-cache-dir","version":"0.1.1","description":"My well-made module","license":"MIT","repository":{"type":"git","url":"git+https://github.com/jamestalmage/find-cache-dir.git"},"author":{"name":"James Talmage","email":"james@talmage.io","url":"github.com/jamestalmage"},"engines":{"node":">=0.10.0"},"scripts":{"test":"xo && nyc --reporter=lcov --reporter=text ava"},"files":["index.js"],"keywords":["cache","directory","dir"],"dependencies":{"commondir":"^1.0.1","mkdirp":"^0.5.1","pkg-dir":"^1.0.0"},"devDependencies":{"ava":"^0.8.0","coveralls":"^2.11.6","nyc":"^5.0.1","rimraf":"^2.5.0","xo":"^0.12.1"},"gitHead":"722fff2aa8fbf666d37192917d2e1fb0e1287489","bugs":{"url":"https://github.com/jamestalmage/find-cache-dir/issues"},"homepage":"https://github.com/jamestalmage/find-cache-dir#readme","_id":"find-cache-dir@0.1.1","_shasum":"c8defae57c8a52a8a784f9e31c57c742e993a0b9","_from":".","_npmVersion":"3.5.2","_nodeVersion":"5.2.0","_npmUser":{"name":"jamestalmage","email":"james@talmage.io"},"dist":{"shasum":"c8defae57c8a52a8a784f9e31c57c742e993a0b9","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/find-cache-dir/-/find-cache-dir-0.1.1.tgz"},"maintainers":[{"name":"jamestalmage","email":"james@talmage.io"}],"directories":{}},"1.0.0":{"name":"find-cache-dir","version":"1.0.0","description":"My well-made module","license":"MIT","repository":{"type":"git","url":"git+https://github.com/avajs/find-cache-dir.git"},"author":{"name":"James Talmage","email":"james@talmage.io","url":"github.com/jamestalmage"},"engines":{"node":">=4"},"scripts":{"test":"xo && nyc ava"},"files":["index.js"],"keywords":["cache","directory","dir","caching","find","search"],"dependencies":{"commondir":"^1.0.1","make-dir":"^1.0.0","pkg-dir":"^2.0.0"},"devDependencies":{"ava":"^0.19.1","coveralls":"^2.11.6","del":"^2.2.2","nyc":"^10.3.2","xo":"^0.18.2"},"nyc":{"reporter":["lcov","text"]},"gitHead":"39c04031f56206e21590e330b483402235ec91b5","bugs":{"url":"https://github.com/avajs/find-cache-dir/issues"},"homepage":"https://github.com/avajs/find-cache-dir#readme","_id":"find-cache-dir@1.0.0","_shasum":"9288e3e9e3cc3748717d39eade17cf71fc30ee6f","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.8.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"9288e3e9e3cc3748717d39eade17cf71fc30ee6f","tarball":"http://nexus.dui88.com:8081/nexus/content/repositories/npm-registry/find-cache-dir/-/find-cache-dir-1.0.0.tgz"},"maintainers":[{"name":"jamestalmage","email":"james@talmage.io"},{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/find-cache-dir-1.0.0.tgz_1494599330398_0.9330564721021801"},"directories":{}}},"name":"find-cache-dir","time":{"modified":"2017-05-12T14:28:50.644Z","created":"2015-12-30T05:27:14.863Z","0.1.0":"2015-12-30T05:27:14.863Z","0.1.1":"2015-12-30T06:15:34.620Z","1.0.0":"2017-05-12T14:28:50.644Z"},"readmeFilename":"readme.md","homepage":"https://github.com/avajs/find-cache-dir#readme"}