afile
Find a file in the list
Install
$ npm install --save afile
Usage
var afile = require('afile');
var targets = [
process.cwd(),
process.env[(process.platform == 'win32') ? 'USERPROFILE' : 'HOME'],
'/'
].map(p => {
return path.join(p, '.bowerrc');
});
afile(targets).then(function (f) {
console.log(f);
}, function () {
});
afile(targets, f => {
console.log(f);
});
API
afile(tagets)
return promise, will resolve if target file is exist.
afile.cb(tagets, cb)
callback style, will pass with target file or not.
License
MIT © Jimmy Moon