mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-11 19:42:23 +08:00
20 lines
441 B
TypeScript
20 lines
441 B
TypeScript
import locatePath = require('locate-path');
|
|
|
|
const files = [
|
|
'unicorn.png',
|
|
'rainbow.png', // only this one actually exists on disk
|
|
'pony.png'
|
|
];
|
|
|
|
let path: string | undefined;
|
|
|
|
locatePath(files).then(foundPath => {
|
|
path = foundPath;
|
|
});
|
|
locatePath(files, {concurrency: 2, preserveOrder: false, cwd: ''}).then(foundPath => {
|
|
path = foundPath;
|
|
});
|
|
|
|
path = locatePath.sync(files);
|
|
path = locatePath.sync(files, {cwd: ''});
|