function mkdirp(path){ var parts = path.split('/'); var now = ''; while (parts.length) { now += parts.shift() + '/'; if (!fs.existsSync(now)) { fs.mkdirSync(now); } }}