code: function find_file(basedir, id, options){
    var filename;
  
    filename = path.join(basedir, id);
    if(fs.existsSync(filename) && fs.statSync(filename).isFile()) return filename;
  
    filename = path.join(basedir, id, options.entry);
    if(fs.existsSync(filename) && fs.statSync(filename).isFile()) return filename;
  
    filename = path.join(basedir, id + options.ext);
    if(fs.existsSync(filename) && fs.statSync(filename).isFile()) return filename;
  }
docs: 从目录中查找文件