Created
September 14, 2023 07:07
-
-
Save neos1803/e9f104dd6af5c76b057a0de011065c98 to your computer and use it in GitHub Desktop.
Creating folder the sync way
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { existsSync, mkdir } = require('fs'); | |
/** Start of creating directory */ | |
const directory = `your path like directory`; | |
if (!existsSync(directory)) { | |
mkdir(directory, { recursive:true }, (err) => { | |
if (err) { | |
return console.error(err); | |
} | |
}) | |
} | |
/** End of creating directory */ | |
// Do the rest of related uploading process |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment