hkhoshraftar
9/3/2018 - 11:26 AM

#nodejs #mkdir

#nodejs #mkdir

const fs = require('fs');
fs.exists('path', function (exists) {
        if (exists) {
            next();
        } else {
            fs.mkdir('path', function (err) {
                if (err) {
                    console.log('Error in folder creation');
                    next();
                }
                next();
            })
        }
    })