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

Check Directory Exist

//check directory exist
string directoryExistPath = @"C:UsersYogeshkumar HadiyaDesktopDirectoryHandling";
if (Directory.Exists(directoryExistPath))
{
    Console.WriteLine("Directory exist");
}
else
{
    Console.WriteLine("Directory not exist");
}
Comment

Check Directory Exist


>>> import os
>>> os.path.isdir('new_folder')
True
>>> os.path.exists(os.path.join(os.getcwd(), 'new_folder', 'file.txt'))
False

Comment

PREVIOUS NEXT
Code Example
Javascript :: go to anchor jquery 
Javascript :: react native password input 
Javascript :: angular JavaScript heap out of memory 
Javascript :: get current url js 
Javascript :: java scripyt code to edit webapge 
Javascript :: javascript get file extension 
Javascript :: how to reload page on button click in javascript 
Javascript :: jquery click add class 
Javascript :: select body with javascript 
Javascript :: jquery preventdefault 
Javascript :: javascript clear localstorage 
Javascript :: textinput disable react native 
Javascript :: content of page fully loaded javascript 
Javascript :: add site url validation regex 
Javascript :: is string javascript 
Javascript :: set attribute checked jquery 
Javascript :: angular clone array without reference 
Javascript :: how to import lodash in react 
Javascript :: disable right click jquery 
Javascript :: intval js 
Javascript :: js even or 
Javascript :: android center text react native 
Javascript :: onclick javascript confirm 
Javascript :: javascript change css float property 
Javascript :: react-native text overflow ellipsis 
Javascript :: get height of div use js 
Javascript :: auto scroll to bottom of page js 
Javascript :: react native animated sticker 
Javascript :: bootstrap show modal on page load 
Javascript :: javascript change comma to dot 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =