Javascript: Create directory recursively if not exists.
function createFileIfNotExists(dirName) {
if (!fs.existsSync(dirName)) {
fs.mkdirSync(dirName, {
recursive: true,
});
}
}
Cheatsheet collection for go, rust, python, shell and javascript.
Javascript: Create directory recursively if not exists.
function createFileIfNotExists(dirName) {
if (!fs.existsSync(dirName)) {
fs.mkdirSync(dirName, {
recursive: true,
});
}
}