1.0.1 • Published 6 years ago
vilian_test_firststep_20180308_mygodisthenamealreadyexistence v1.0.1
#学习使用node文件模块 ##判断文件是否存在
var fs = require('fs');
fs.stat('/xxx', function(err, stat){
if(stat&&stat.isFile()) {
console.log('文件存在');
} else {
console.log('文件不存在或不是标准文件');
}
})