Skip to content

Instantly share code, notes, and snippets.

@neos1803
Created September 14, 2023 07:07
Show Gist options
  • Save neos1803/e9f104dd6af5c76b057a0de011065c98 to your computer and use it in GitHub Desktop.
Save neos1803/e9f104dd6af5c76b057a0de011065c98 to your computer and use it in GitHub Desktop.
Creating folder the sync way
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