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');