UNPKG

hiproxy

Version:

hiproxy - lightweight and powerful proxy tool for front-end developer based on Node.js.

24 lines (20 loc) 343 B
/** * @file mkdirp * @author zdying */ 'use strict'; var fs = require('fs'); var path = require('path'); module.exports = function mkdirp (dir) { if (fs.existsSync(dir)) { return; } try { fs.mkdirSync(dir); } catch (err) { if (err.code === 'ENOENT') { mkdirp(path.dirname(dir)); mkdirp(dir); } } };