1var fs = require('fs');
2
3const dir = './database/temp';
4if (!fs.existsSync(dir)) {
5 fs.mkdirSync(dir, {
6 recursive: true
7 });
8}
1var fs = require('fs');
2var dir = './tmp';
3if (!fs.existsSync(dir)){
4 fs.mkdirSync(dir);
5}
6
7// or if complains about existence and nesting doesn't matter:
8
9var shell = require('shelljs');
10shell.mkdir('-p', 'root/parent/tmp');
1//Include fs module
2const fs = require('fs');
3
4const dir = './dir'
5fs.mkdir(dir);
1const fs = require("fs");
2
3if (!fs.existsSync(dirName)) fs.mkdirSync(dirName, { recursive: true });
4