Repository URL to install this package:
|
Version:
0.0.0-dbbf5e9efabe69 ▾
|
const fs = require('fs');
const makeDirectoryIfNotExistsSync = directory => {
if (typeof directory !== 'string') {
throw new Error(`makeDirectoryIfNotExistsSync expects a string, got ${typeof directory}`);
}
try {
fs.statSync(directory);
} catch (e) {
fs.mkdirSync(directory);
}
};
module.exports = {
makeDirectoryIfNotExistsSync,
};