Could you please change it to asynchronous?
function Base(directory) {
//...
if (!fs.statSync(directory).isDirectory()) {
throw new Error("Path " + directory + " is not directory");
}
//...
}
fs.stat(directory,function(err,stat){
if(err || !stat.isDirectory()) {
throw new Error("Path " + directory + " is not directory");
}
});
Could you please change it to asynchronous?