Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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');
 
PREVIOUS NEXT
Tagged: #nodejs #directory
ADD COMMENT
Topic
Name
9+8 =