Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

nodejs check directory exist or not

var fs = require('fs');
if (!fs.existsSync(newDest)) fs.mkdirSync(newDest,'0777', true);
Comment

how to check if a folder exists in node js

const fs = require("fs")

fs.access("./directory-name", function(error) {
  if (error) {
    console.log("Directory does not exist.")
  } else {
    console.log("Directory exists.")
  }
})
Comment

PREVIOUS NEXT
Code Example
Javascript :: Required a safe HTML, got a ResourceURL 
Javascript :: jquery loop through class inside the div 
Javascript :: loopback float type 
Javascript :: codewars playing with digits js 
Javascript :: Javascript Remove Element By Id Code Example 
Javascript :: ubuntu nodejs update 
Javascript :: postman check for null or undefined 
Javascript :: sinha crud template 
Javascript :: js how to know if element touch border 
Javascript :: webkit-media-controls-timeline apply by jquery 
Javascript :: how to only accept email in the format of name@domain.com js 
Javascript :: javascript get a random number with 6 digits 
Javascript :: tailwind css not working with react 
Javascript :: creare component in anglar 
Javascript :: deploy create react app pm2 
Javascript :: javascript calculate days between dates 
Javascript :: __dirname go back one directory 
Javascript :: set defaultValue for select element jsx 
Javascript :: json schmea typs 
Javascript :: open route in new tab vue router 
Javascript :: js check if object has property 
Javascript :: react-router-dom v6 redirect 
Javascript :: toggle jquery remove others 
Javascript :: jquery datetimepicker format 
Javascript :: float force loopback 
Javascript :: javascript number to number with commas 
Javascript :: js escape ampersand 
Javascript :: less than or equal js 
Javascript :: angular generate component 
Javascript :: rafraichir page javascript 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =