CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
readme.md126 linesDownload Raw Back to locate-path
1# locate-path [![Build Status](https://travis-ci.com/sindresorhus/locate-path.svg?branch=master)](https://travis-ci.com/github/sindresorhus/locate-path)2 3> Get the first path that exists on disk of multiple paths4 5## Install6 7```8$ npm install locate-path9```10 11## Usage12 13Here we find the first file that exists on disk, in array order.14 15```js16const locatePath = require('locate-path');17 18const files = [19	'unicorn.png',20	'rainbow.png', // Only this one actually exists on disk21	'pony.png'22];23 24(async () => {25	console(await locatePath(files));26	//=> 'rainbow'27})();28```29 30## API31 32### locatePath(paths, options?)33 34Returns a `Promise<string>` for the first path that exists or `undefined` if none exists.35 36#### paths37 38Type: `Iterable<string>`39 40Paths to check.41 42#### options43 44Type: `object`45 46##### concurrency47 48Type: `number`\49Default: `Infinity`\50Minimum: `1`51 52Number of concurrently pending promises.53 54##### preserveOrder55 56Type: `boolean`\57Default: `true`58 59Preserve `paths` order when searching.60 61Disable this to improve performance if you don't care about the order.62 63##### cwd64 65Type: `string`\66Default: `process.cwd()`67 68Current working directory.69 70##### type71 72Type: `string`\73Default: `'file'`\74Values: `'file' | 'directory'`75 76The type of paths that can match.77 78##### allowSymlinks79 80Type: `boolean`\81Default: `true`82 83Allow symbolic links to match if they point to the chosen path type.84 85### locatePath.sync(paths, options?)86 87Returns the first path that exists or `undefined` if none exists.88 89#### paths90 91Type: `Iterable<string>`92 93Paths to check.94 95#### options96 97Type: `object`98 99##### cwd100 101Same as above.102 103##### type104 105Same as above.106 107##### allowSymlinks108 109Same as above.110 111## Related112 113- [path-exists](https://github.com/sindresorhus/path-exists) - Check if a path exists114 115---116 117<div align="center">118	<b>119		<a href="https://tidelift.com/subscription/pkg/npm-locate-path?utm_source=npm-locate-path&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>120	</b>121	<br>122	<sub>123		Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.124	</sub>125</div>126 
basant307/AI_Governance_Project · CoolFace