PHP 8.2.30
Preview: index.js Size: 512 B
/opt/alt/alt-nodejs8/root/lib/node_modules/npm/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, 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;
		}
	}
};

Directory Contents

Dirs: 0 × Files: 4

Name Size Perms Modified Actions
512 B lrw-r--r-- 2021-09-28 10:29:16
Edit Download
1.09 KB lrw-r--r-- 2021-09-28 10:29:16
Edit Download
1.72 KB lrw-r--r-- 2021-09-28 10:29:16
Edit Download
1.51 KB lrw-r--r-- 2021-09-28 10:29:16
Edit Download

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