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.cb(targets, f => {
console.log(f);
});
afile.sync(targets);
});
API
afile(tagets)
return promise, will resolve if target file is exist.
afile.cb(tagets, cb)
callback style, will pass with target file path or not.
afile.sync(targets)
return target file path or null.
License
MIT © Jimmy Moon