Node.js examples for File:Directory
Recursive create folder
var path = require('path'); var fs = require('fs'); var crypto = require('crypto'); /*sync recursive create folder*/ exports.mkdirSync = function(mkPath){ var parentPath = path.dirname(mkPath); if(!fs.existsSync(parentPath)){ exports.mkdirSync(parentPath);/*from w w w.j a v a2 s . co m*/ } if(!fs.existsSync(mkPath)){ fs.mkdirSync(mkPath); } }