77849/how-to-create-a-directory-if-it-doesn-t-exist-using-node-js
Is this the right way to create a directory if it doesn't exist. It should have full permission for the script and readable by others.
var dir = __dirname + '/upload'; if (!path.existsSync(dir)) { fs.mkdirSync(dir, 0744); }
Hello @kartik,
Try this:
var fs = require('fs'); var dir = './tmp'; if (!fs.existsSync(dir)){ fs.mkdirSync(dir); }
Hope it helps!! Thank you!!
Hello @kartik, It's particularly useful if you're concerned ...READ MORE
Hii, You can create an HTTP GET request and pipe ...READ MORE
Hello @kartik, To print stacktrace of Error in console in ...READ MORE
Hello @kartik, The minimal setup for an HTTPS ...READ MORE
Hey @kartik, First you must have xampp install ...READ MORE
Hello, First you need to have laravel install ...READ MORE
Hii, First you need to start Apache and ...READ MORE
Hey, You just need to go Laravel folder through ...READ MORE
Hello @kartik, Try: var fs = require('fs'); var dir = ...READ MORE
Hello @kartik, nodejs v10.12 now supports this natively ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.