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 +
var filessystem = require('fs'); var dir = './path/subpath/'; if (!filessystem.existsSync(dir)){ filessystem.mkdirSync(dir); }else { console.log("Directory already exist"); }
This may help you :)