diff options
Diffstat (limited to 'node_modules/locate-path')
-rw-r--r-- | node_modules/locate-path/index.js | 24 | ||||
-rw-r--r-- | node_modules/locate-path/license | 21 | ||||
-rw-r--r-- | node_modules/locate-path/package.json | 47 | ||||
-rw-r--r-- | node_modules/locate-path/readme.md | 99 |
4 files changed, 0 insertions, 191 deletions
diff --git a/node_modules/locate-path/index.js b/node_modules/locate-path/index.js deleted file mode 100644 index 32b108d19..000000000 --- a/node_modules/locate-path/index.js +++ /dev/null @@ -1,24 +0,0 @@ -'use strict'; -const path = require('path'); -const pathExists = require('path-exists'); -const pLocate = require('p-locate'); - -module.exports = (iterable, opts) => { - opts = Object.assign({ - cwd: process.cwd() - }, opts); - - return pLocate(iterable, el => pathExists(path.resolve(opts.cwd, el)), opts); -}; - -module.exports.sync = (iterable, opts) => { - opts = Object.assign({ - cwd: process.cwd() - }, opts); - - for (const el of iterable) { - if (pathExists.sync(path.resolve(opts.cwd, el))) { - return el; - } - } -}; diff --git a/node_modules/locate-path/license b/node_modules/locate-path/license deleted file mode 100644 index 654d0bfe9..000000000 --- a/node_modules/locate-path/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/locate-path/package.json b/node_modules/locate-path/package.json deleted file mode 100644 index 17bcd7ff6..000000000 --- a/node_modules/locate-path/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "locate-path", - "version": "2.0.0", - "description": "Get the first path that exists on disk of multiple paths", - "license": "MIT", - "repository": "sindresorhus/locate-path", - "author": { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - "engines": { - "node": ">=4" - }, - "scripts": { - "test": "xo && ava" - }, - "files": [ - "index.js" - ], - "keywords": [ - "locate", - "path", - "paths", - "file", - "files", - "exists", - "find", - "finder", - "search", - "searcher", - "array", - "iterable", - "iterator" - ], - "dependencies": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - }, - "devDependencies": { - "ava": "*", - "xo": "*" - }, - "xo": { - "esnext": true - } -} diff --git a/node_modules/locate-path/readme.md b/node_modules/locate-path/readme.md deleted file mode 100644 index f7b337bb2..000000000 --- a/node_modules/locate-path/readme.md +++ /dev/null @@ -1,99 +0,0 @@ -# locate-path [![Build Status](https://travis-ci.org/sindresorhus/locate-path.svg?branch=master)](https://travis-ci.org/sindresorhus/locate-path) - -> Get the first path that exists on disk of multiple paths - - -## Install - -``` -$ npm install --save locate-path -``` - - -## Usage - -Here we find the first file that exists on disk, in array order. - -```js -const locatePath = require('locate-path'); - -const files = [ - 'unicorn.png', - 'rainbow.png', // only this one actually exists on disk - 'pony.png' -]; - -locatePath(files).then(foundPath => { - console.log(foundPath); - //=> 'rainbow' -}); -``` - - -## API - -### locatePath(input, [options]) - -Returns a `Promise` for the first path that exists or `undefined` if none exists. - -#### input - -Type: `Iterable<string>` - -Paths to check. - -#### options - -Type: `Object` - -##### concurrency - -Type: `number`<br> -Default: `Infinity`<br> -Minimum: `1` - -Number of concurrently pending promises. - -##### preserveOrder - -Type: `boolean`<br> -Default: `true` - -Preserve `input` order when searching. - -Disable this to improve performance if you don't care about the order. - -##### cwd - -Type: `string`<br> -Default: `process.cwd()` - -Current working directory. - -### locatePath.sync(input, [options]) - -Returns the first path that exists or `undefined` if none exists. - -#### input - -Type: `Iterable<string>` - -Paths to check. - -#### options - -Type: `Object` - -##### cwd - -Same as above. - - -## Related - -- [path-exists](https://github.com/sindresorhus/path-exists) - Check if a path exists - - -## License - -MIT © [Sindre Sorhus](https://sindresorhus.com) |