2
我有这样的代码在这里:为什么需要和fs.existSync使用不同的相对路径
if(fs.existsSync('./example/example.js')){
cb(require('../example/example.js'));
}else{
cb();
}
为什么要fs.existSync
是使用不同的目录require
?
这将是不包括的东西不需要目录树......(我用快递BTW)
\example
example.js
\routes
index.js <-- this is the one where I am using this code
app.js <-- this one requires index.js and calls its functions using app.get('/example',example.index);
我不明白'接近'票,我认为这是一个适当的问题。 – robertklep
这是一个正确的问题-.- – FabianCook