📚Cheatsheets

Cheatsheet collection for go, rust, python, shell and javascript.

createFileIfNotExists

Javascript: Create directory recursively if not exists.

function createFileIfNotExists(dirName) {
    if (!fs.existsSync(dirName)) {
        fs.mkdirSync(dirName, {
            recursive: true,
        });
    }
}