forked from Mirrors/OpenAsar
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
329 B
14 lines
329 B
// Minimal wrapper mimicking mkdirp package
|
|
const fs = require('fs');
|
|
|
|
const mk = (path, callback) => { // async
|
|
fs.mkdir(path, { recursive: true }, () => callback()); // Never error
|
|
};
|
|
|
|
mk.sync = (path) => { // sync
|
|
try {
|
|
fs.mkdirSync(path, { recursive: true });
|
|
} catch (e) { } // Never error
|
|
};
|
|
|
|
module.exports = mk; |