Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

node js create folder

var fs = require('fs');

const dir = './database/temp';
if (!fs.existsSync(dir)) {
	fs.mkdirSync(dir, {
		recursive: true
	});
}
Comment

nodejs make directory

var fs = require('fs');
var dir = './tmp';
if (!fs.existsSync(dir)){
    fs.mkdirSync(dir);
}

// or if complains about existence and nesting doesn't matter:

var shell = require('shelljs');
shell.mkdir('-p', 'root/parent/tmp');
Comment

node.js fs create directory

import fs from "fs";
const fsp = fs.promises;

const makeDir = async () => {
    try {
        await fsp.mkdir('blogPost')
    } catch (err) {
        console.log(err);
    }
}

makeDir()
Comment

how to create a folder in node js

const fs = require("fs");

if (!fs.existsSync(dirName)) fs.mkdirSync(dirName, { recursive: true });
Comment

PREVIOUS NEXT
Code Example
Javascript :: get localstorage 
Javascript :: select a form by name jquery 
Javascript :: json_decode jquery 
Javascript :: get page resolution jquery 
Javascript :: puppeteer how to serch for text 
Javascript :: javascript get device gpu info 
Javascript :: javascript get years since a date 
Javascript :: add select option javascript 
Javascript :: Manifest 3 content security policy 
Javascript :: js change video src 
Javascript :: jquery select by data attribute 
Javascript :: how to find parent table of tr in jquery 
Javascript :: create a new input with type checkbox javascript 
Javascript :: regex do not contain 
Javascript :: how to wait foreach javascript 
Javascript :: align left text in reactstrap 
Javascript :: unique string generator javascript 
Javascript :: carousel speed bootstrap 
Javascript :: calculate age based on date of birth in javascript 
Javascript :: javascript get base url 
Javascript :: javascript scroll to bottom 
Javascript :: strip html tags javascript 
Javascript :: react-native release build 
Javascript :: react after deployment givin nginx 404 
Javascript :: textField space between text flutter 
Javascript :: js get first element by class 
Javascript :: readonly javascript 
Javascript :: find item in object js 
Javascript :: javascript detect collision 
Javascript :: react native detect production 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =