Is this the right way to create a directory if it doesn't exist. It should have full permission for the script and readable by others.
var dir = __dirname + '/upload';
if (!path.existsSync(dir)) {
fs.mkdirSync(dir, 0744);
}
转载于:https://stackoverflow.com/questions/21194934/node-how-to-create-a-directory-if-doesnt-exist