aboutsummaryrefslogtreecommitdiff
path: root/node_modules/find-cache-dir
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2018-09-20 02:56:13 +0200
committerFlorian Dold <florian.dold@gmail.com>2018-09-20 02:56:13 +0200
commitbbff7403fbf46f9ad92240ac213df8d30ef31b64 (patch)
treec58400ec5124da1c7d56b01aea83309f80a56c3b /node_modules/find-cache-dir
parent003fb34971cf63466184351b4db5f7c67df4f444 (diff)
update packages
Diffstat (limited to 'node_modules/find-cache-dir')
-rw-r--r--node_modules/find-cache-dir/index.js17
l---------node_modules/find-cache-dir/node_modules/.bin/mkdirp1
-rw-r--r--node_modules/find-cache-dir/node_modules/find-up/index.js53
-rw-r--r--node_modules/find-cache-dir/node_modules/find-up/license21
-rw-r--r--node_modules/find-cache-dir/node_modules/find-up/package.json51
-rw-r--r--node_modules/find-cache-dir/node_modules/find-up/readme.md72
-rw-r--r--node_modules/find-cache-dir/node_modules/pkg-dir/index.js14
-rw-r--r--node_modules/find-cache-dir/node_modules/pkg-dir/license21
-rw-r--r--node_modules/find-cache-dir/node_modules/pkg-dir/package.json54
-rw-r--r--node_modules/find-cache-dir/node_modules/pkg-dir/readme.md63
-rw-r--r--node_modules/find-cache-dir/package.json31
-rw-r--r--node_modules/find-cache-dir/readme.md47
12 files changed, 55 insertions, 390 deletions
diff --git a/node_modules/find-cache-dir/index.js b/node_modules/find-cache-dir/index.js
index 859286285..2502e4433 100644
--- a/node_modules/find-cache-dir/index.js
+++ b/node_modules/find-cache-dir/index.js
@@ -1,12 +1,13 @@
'use strict';
-var path = require('path');
-var commonDir = require('commondir');
-var pkgDir = require('pkg-dir');
-var mkdirp = require('mkdirp');
+const path = require('path');
+const commonDir = require('commondir');
+const pkgDir = require('pkg-dir');
+const makeDir = require('make-dir');
+
+module.exports = options => {
+ const name = options.name;
+ let dir = options.cwd;
-module.exports = function (options) {
- var name = options.name;
- var dir = options.cwd;
if (options.files) {
dir = commonDir(dir, options.files);
} else {
@@ -19,7 +20,7 @@ module.exports = function (options) {
dir = path.join(dir, 'node_modules', '.cache', name);
if (dir && options.create) {
- mkdirp.sync(dir);
+ makeDir.sync(dir);
}
if (options.thunk) {
diff --git a/node_modules/find-cache-dir/node_modules/.bin/mkdirp b/node_modules/find-cache-dir/node_modules/.bin/mkdirp
deleted file mode 120000
index 91a5f623f..000000000
--- a/node_modules/find-cache-dir/node_modules/.bin/mkdirp
+++ /dev/null
@@ -1 +0,0 @@
-../../../mkdirp/bin/cmd.js \ No newline at end of file
diff --git a/node_modules/find-cache-dir/node_modules/find-up/index.js b/node_modules/find-cache-dir/node_modules/find-up/index.js
deleted file mode 100644
index 7ff0e2b78..000000000
--- a/node_modules/find-cache-dir/node_modules/find-up/index.js
+++ /dev/null
@@ -1,53 +0,0 @@
-'use strict';
-var path = require('path');
-var pathExists = require('path-exists');
-var Promise = require('pinkie-promise');
-
-function splitPath(x) {
- return path.resolve(x || '').split(path.sep);
-}
-
-function join(parts, filename) {
- return path.resolve(parts.join(path.sep) + path.sep, filename);
-}
-
-module.exports = function (filename, opts) {
- opts = opts || {};
-
- var parts = splitPath(opts.cwd);
-
- return new Promise(function (resolve) {
- (function find() {
- var fp = join(parts, filename);
-
- pathExists(fp).then(function (exists) {
- if (exists) {
- resolve(fp);
- } else if (parts.pop()) {
- find();
- } else {
- resolve(null);
- }
- });
- })();
- });
-};
-
-module.exports.sync = function (filename, opts) {
- opts = opts || {};
-
- var parts = splitPath(opts.cwd);
- var len = parts.length;
-
- while (len--) {
- var fp = join(parts, filename);
-
- if (pathExists.sync(fp)) {
- return fp;
- }
-
- parts.pop();
- }
-
- return null;
-};
diff --git a/node_modules/find-cache-dir/node_modules/find-up/license b/node_modules/find-cache-dir/node_modules/find-up/license
deleted file mode 100644
index 654d0bfe9..000000000
--- a/node_modules/find-cache-dir/node_modules/find-up/license
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/node_modules/find-cache-dir/node_modules/find-up/package.json b/node_modules/find-cache-dir/node_modules/find-up/package.json
deleted file mode 100644
index 478866c49..000000000
--- a/node_modules/find-cache-dir/node_modules/find-up/package.json
+++ /dev/null
@@ -1,51 +0,0 @@
-{
- "name": "find-up",
- "version": "1.1.2",
- "description": "Find a file by walking up parent directories",
- "license": "MIT",
- "repository": "sindresorhus/find-up",
- "author": {
- "name": "Sindre Sorhus",
- "email": "sindresorhus@gmail.com",
- "url": "sindresorhus.com"
- },
- "engines": {
- "node": ">=0.10.0"
- },
- "scripts": {
- "test": "xo && ava"
- },
- "files": [
- "index.js"
- ],
- "keywords": [
- "find",
- "up",
- "find-up",
- "findup",
- "look-up",
- "look",
- "file",
- "search",
- "match",
- "package",
- "resolve",
- "parent",
- "parents",
- "folder",
- "directory",
- "dir",
- "walk",
- "walking",
- "path"
- ],
- "dependencies": {
- "path-exists": "^2.0.0",
- "pinkie-promise": "^2.0.0"
- },
- "devDependencies": {
- "ava": "*",
- "tempfile": "^1.1.1",
- "xo": "*"
- }
-}
diff --git a/node_modules/find-cache-dir/node_modules/find-up/readme.md b/node_modules/find-cache-dir/node_modules/find-up/readme.md
deleted file mode 100644
index 9ea0611c3..000000000
--- a/node_modules/find-cache-dir/node_modules/find-up/readme.md
+++ /dev/null
@@ -1,72 +0,0 @@
-# find-up [![Build Status](https://travis-ci.org/sindresorhus/find-up.svg?branch=master)](https://travis-ci.org/sindresorhus/find-up)
-
-> Find a file by walking up parent directories
-
-
-## Install
-
-```
-$ npm install --save find-up
-```
-
-
-## Usage
-
-```
-/
-└── Users
- └── sindresorhus
- ├── unicorn.png
- └── foo
- └── bar
- ├── baz
- └── example.js
-```
-
-```js
-// example.js
-const findUp = require('find-up');
-
-findUp('unicorn.png').then(filepath => {
- console.log(filepath);
- //=> '/Users/sindresorhus/unicorn.png'
-});
-```
-
-
-## API
-
-### findUp(filename, [options])
-
-Returns a promise for the filepath or `null`.
-
-### findUp.sync(filename, [options])
-
-Returns a filepath or `null`.
-
-#### filename
-
-Type: `string`
-
-Filename of the file to find.
-
-#### options
-
-##### cwd
-
-Type: `string`
-Default: `process.cwd()`
-
-Directory to start from.
-
-
-## Related
-
-- [find-up-cli](https://github.com/sindresorhus/find-up-cli) - CLI for this module
-- [pkg-up](https://github.com/sindresorhus/pkg-up) - Find the closest package.json file
-- [pkg-dir](https://github.com/sindresorhus/pkg-dir) - Find the root directory of an npm package
-
-
-## License
-
-MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/node_modules/find-cache-dir/node_modules/pkg-dir/index.js b/node_modules/find-cache-dir/node_modules/pkg-dir/index.js
deleted file mode 100644
index ab09a3f12..000000000
--- a/node_modules/find-cache-dir/node_modules/pkg-dir/index.js
+++ /dev/null
@@ -1,14 +0,0 @@
-'use strict';
-var path = require('path');
-var findUp = require('find-up');
-
-module.exports = function (cwd) {
- return findUp('package.json', {cwd: cwd}).then(function (fp) {
- return fp ? path.dirname(fp) : null;
- });
-};
-
-module.exports.sync = function (cwd) {
- var fp = findUp.sync('package.json', {cwd: cwd});
- return fp ? path.dirname(fp) : null;
-};
diff --git a/node_modules/find-cache-dir/node_modules/pkg-dir/license b/node_modules/find-cache-dir/node_modules/pkg-dir/license
deleted file mode 100644
index 654d0bfe9..000000000
--- a/node_modules/find-cache-dir/node_modules/pkg-dir/license
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/node_modules/find-cache-dir/node_modules/pkg-dir/package.json b/node_modules/find-cache-dir/node_modules/pkg-dir/package.json
deleted file mode 100644
index 81f38d5cd..000000000
--- a/node_modules/find-cache-dir/node_modules/pkg-dir/package.json
+++ /dev/null
@@ -1,54 +0,0 @@
-{
- "name": "pkg-dir",
- "version": "1.0.0",
- "description": "Find the root directory of a npm package",
- "license": "MIT",
- "repository": "sindresorhus/pkg-dir",
- "author": {
- "name": "Sindre Sorhus",
- "email": "sindresorhus@gmail.com",
- "url": "sindresorhus.com"
- },
- "engines": {
- "node": ">=0.10.0"
- },
- "scripts": {
- "test": "xo && ava"
- },
- "files": [
- "index.js"
- ],
- "keywords": [
- "package",
- "json",
- "root",
- "npm",
- "entry",
- "find",
- "up",
- "find-up",
- "findup",
- "look-up",
- "look",
- "file",
- "search",
- "match",
- "package",
- "resolve",
- "parent",
- "parents",
- "folder",
- "directory",
- "dir",
- "walk",
- "walking",
- "path"
- ],
- "dependencies": {
- "find-up": "^1.0.0"
- },
- "devDependencies": {
- "ava": "*",
- "xo": "*"
- }
-}
diff --git a/node_modules/find-cache-dir/node_modules/pkg-dir/readme.md b/node_modules/find-cache-dir/node_modules/pkg-dir/readme.md
deleted file mode 100644
index 82bb83517..000000000
--- a/node_modules/find-cache-dir/node_modules/pkg-dir/readme.md
+++ /dev/null
@@ -1,63 +0,0 @@
-# pkg-dir [![Build Status](https://travis-ci.org/sindresorhus/pkg-dir.svg?branch=master)](https://travis-ci.org/sindresorhus/pkg-dir)
-
-> Find the root directory of a npm package
-
-
-## Install
-
-```
-$ npm install --save pkg-dir
-```
-
-
-## Usage
-
-```
-/
-└── Users
- └── sindresorhus
- └── foo
- ├── package.json
- └── bar
- ├── baz
- └── example.js
-```
-
-```js
-// example.js
-var pkgDir = require('pkg-dir');
-
-pkgDir(__dirname).then(function (rootPath) {
- console.log(rootPath);
- //=> '/Users/sindresorhus/foo'
-});
-```
-
-
-## API
-
-### pkgDir([cwd])
-
-Returns a promise that resolves to the package root path or `null`.
-
-### pkgDir.sync([cwd])
-
-Returns the package root path or `null`.
-
-#### cwd
-
-Type: `string`
-Default: `process.cwd()`
-
-Directory to start from.
-
-
-## Related
-
-- [pkg-dir-cli](https://github.com/sindresorhus/pkg-dir-cli) - CLI for this module
-- [find-up](https://github.com/sindresorhus/find-up) - Find a file by walking up parent directories
-
-
-## License
-
-MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/node_modules/find-cache-dir/package.json b/node_modules/find-cache-dir/package.json
index 1af1793cb..bf5a64db1 100644
--- a/node_modules/find-cache-dir/package.json
+++ b/node_modules/find-cache-dir/package.json
@@ -1,19 +1,19 @@
{
"name": "find-cache-dir",
- "version": "0.1.1",
+ "version": "1.0.0",
"description": "My well-made module",
"license": "MIT",
- "repository": "jamestalmage/find-cache-dir",
+ "repository": "avajs/find-cache-dir",
"author": {
"name": "James Talmage",
"email": "james@talmage.io",
"url": "github.com/jamestalmage"
},
"engines": {
- "node": ">=0.10.0"
+ "node": ">=4"
},
"scripts": {
- "test": "xo && nyc --reporter=lcov --reporter=text ava"
+ "test": "xo && nyc ava"
},
"files": [
"index.js"
@@ -21,18 +21,27 @@
"keywords": [
"cache",
"directory",
- "dir"
+ "dir",
+ "caching",
+ "find",
+ "search"
],
"dependencies": {
"commondir": "^1.0.1",
- "mkdirp": "^0.5.1",
- "pkg-dir": "^1.0.0"
+ "make-dir": "^1.0.0",
+ "pkg-dir": "^2.0.0"
},
"devDependencies": {
- "ava": "^0.8.0",
+ "ava": "^0.19.1",
"coveralls": "^2.11.6",
- "nyc": "^5.0.1",
- "rimraf": "^2.5.0",
- "xo": "^0.12.1"
+ "del": "^2.2.2",
+ "nyc": "^10.3.2",
+ "xo": "^0.18.2"
+ },
+ "nyc": {
+ "reporter": [
+ "lcov",
+ "text"
+ ]
}
}
diff --git a/node_modules/find-cache-dir/readme.md b/node_modules/find-cache-dir/readme.md
index d0b71b19f..447d62020 100644
--- a/node_modules/find-cache-dir/readme.md
+++ b/node_modules/find-cache-dir/readme.md
@@ -1,8 +1,8 @@
-# find-cache-dir [![Build Status](https://travis-ci.org/jamestalmage/find-cache-dir.svg?branch=master)](https://travis-ci.org/jamestalmage/find-cache-dir) [![Coverage Status](https://coveralls.io/repos/jamestalmage/find-cache-dir/badge.svg?branch=master&service=github)](https://coveralls.io/github/jamestalmage/find-cache-dir?branch=master)
+# 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)
-> Finds the common standard cache directory.
+> Finds the common standard cache directory
-Recently the [`nyc`](https://www.npmjs.com/package/nyc) and [`AVA`](https://www.npmjs.com/package/ava) projects decided to standardize on a common directory structure for storing cache information:
+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
@@ -16,12 +16,12 @@ Recently the [`nyc`](https://www.npmjs.com/package/nyc) and [`AVA`](https://www.
```
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.
+If you decide to adopt this pattern, please file a PR adding your name to the list of adopters below.
## Install
@@ -37,7 +37,7 @@ $ npm install --save find-cache-dir
const findCacheDir = require('find-cache-dir');
findCacheDir({name: 'unicorns'});
-//=> /user/path/node-modules/.cache/unicorns
+//=> '/user/path/node-modules/.cache/unicorns'
```
@@ -45,40 +45,40 @@ findCacheDir({name: 'unicorns'});
### findCacheDir([options])
-Finds the cache dir 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.
+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*
-Type: `string`
+*Required*<br>
+Type: `string`
-This should be the same as your project name in `package.json`.
+Should be the same as your project name in `package.json`.
##### files
-Type: `array` of `string`
+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`
+Type: `string`<br>
Default `process.cwd()`
-The directory to start searching for a `package.json` from.
+Directory to start searching for a `package.json` from.
##### create
-Type: `boolean`
+Type: `boolean`<br>
Default `false`
If `true`, the directory will be created synchronously before returning.
##### thunk
-Type: `boolean`
+Type: `boolean`<br>
Default `false`
If `true`, this modifies the return type to be a function that is a thunk for `path.join(theFoundCacheDirectory)`.
@@ -87,22 +87,27 @@ If `true`, this modifies the return type to be a function that is a thunk for `p
const thunk = findCacheDir({name: 'foo', thunk: true});
thunk();
-//=> /some/path/node_modules/.cache/foo
+//=> '/some/path/node_modules/.cache/foo'
thunk('bar.js')
-//=> /some/path/node_modules/.cache/foo/bar.js
+//=> '/some/path/node_modules/.cache/foo/bar.js'
thunk('baz', 'quz.js')
-//=> /some/path/node_modules/.cache/foo/baz/quz.js
+//=> '/some/path/node_modules/.cache/foo/baz/quz.js'
```
This is helpful for actually putting actual files in the cache!
+
## Adopters
-- [`NYC`](https://www.npmjs.com/package/nyc)
-- [`AVA`](https://www.npmjs.com/package/ava)
+- [`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](http://github.com/jamestalmage)
+MIT © [James Talmage](https://github.com/jamestalmage)