find-file

Search for a file in an array of paths

find-file

Search for a file in an array of paths

$ npm install --save find-file
var Find = require('find-file');
 
var find = new Find()
    .name('foo.jpg')
    .where(['./images', './media']);
 
find.run(function (errfiles) {
    if (err) {
        throw err;
    }
 
    console.log(files);
    //=> [{ path: 'images/foo.jpg', name: 'foo.jpg', ...}] 
});

MIT © Kevin Mårtensson