Files
DefinitelyTyped/types/locate-path/locate-path-tests.ts
2017-08-08 13:54:03 -07:00

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: ''});