OpenAsar/poly/mkdirp.js

14 lines
293 B
JavaScript
Raw Normal View History

// Minimal wrapper mimicking mkdirp package
2022-04-03 20:09:38 +00:00
const F = require('fs');
2022-04-03 20:09:38 +00:00
const M = (p, c) => { // async
F.mkdir(p, { recursive: true }, () => c()); // Never error
};
2022-04-03 20:09:38 +00:00
M.sync = (p) => { // sync
try {
2022-04-03 20:09:38 +00:00
F.mkdirSync(p, { recursive: true });
} catch { } // Never error
};
2022-04-03 20:09:38 +00:00
module.exports = M;