Submit
Path:
~
/
/
proc
/
thread-self
/
root
/
opt
/
alt
/
alt-nodejs11
/
root
/
lib
/
node_modules
/
npm
/
node_modules
/
locate-path
/
File Content:
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; } } };
Edit
Rename
Chmod
Delete
FILE
FOLDER
Name
Size
Permission
Action
index.js
512 bytes
0644
license
1119 bytes
0644
package.json
1757 bytes
0644
readme.md
1545 bytes
0644
N4ST4R_ID | Naxtarrr