PHP 8.2.30
Preview: index.js Size: 539 B
//proc/thread-self/root/home/byroehnu/.trash/node_modules11/pkg-dir/node_modules/locate-path/index.js

'use strict';
const path = require('path');
const pathExists = require('path-exists');
const pLocate = require('p-locate');

module.exports = (iterable, options) => {
	options = Object.assign({
		cwd: process.cwd()
	}, options);

	return pLocate(iterable, el => pathExists(path.resolve(options.cwd, el)), options);
};

module.exports.sync = (iterable, options) => {
	options = Object.assign({
		cwd: process.cwd()
	}, options);

	for (const el of iterable) {
		if (pathExists.sync(path.resolve(options.cwd, el))) {
			return el;
		}
	}
};

Directory Contents

Dirs: 0 × Files: 4

Name Size Perms Modified Actions
539 B lrw-r--r-- 2026-02-28 00:26:42
Edit Download
1.08 KB lrw-r--r-- 2026-02-28 00:26:52
Edit Download
694 B lrw-r--r-- 2026-02-28 00:26:32
Edit Download
1.49 KB lrw-r--r-- 2026-02-28 00:27:04
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).