2021-12-10 18:29:52 +00:00
|
|
|
// Minimal wrapper mimicking mkdirp package
|
|
|
|
const fs = require('fs');
|
|
|
|
|
2022-01-25 22:48:40 +00:00
|
|
|
const mk = (path, callback) => { // async
|
2022-01-29 10:12:24 +00:00
|
|
|
fs.mkdir(path, { recursive: true }, () => callback()); // Never error
|
2021-12-10 18:29:52 +00:00
|
|
|
};
|
|
|
|
|
2022-01-25 22:48:40 +00:00
|
|
|
mk.sync = (path) => { // sync
|
2021-12-10 18:29:52 +00:00
|
|
|
try {
|
|
|
|
fs.mkdirSync(path, { recursive: true });
|
2022-01-29 10:12:24 +00:00
|
|
|
} catch (e) { } // Never error
|
2021-12-10 18:29:52 +00:00
|
|
|
};
|
|
|
|
|
2022-01-25 22:48:40 +00:00
|
|
|
module.exports = mk;
|