Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a local directory using Electron

I am pretty new with electron. Can anyone suggest me how to create a local folder using the electron. I see JavaScript does not have that capability.

like image 502
RosAng Avatar asked Oct 07 '15 10:10

RosAng


1 Answers

The file system module (fs) is also available in electron. You can use mkdir to create a directory:

var fs = require('fs');

// Without checking if dir already exists
fs.mkdir('PATH/TO/DIR');

// With checking if dir already exists
if (!fs.existsSync('PATH/TO/DIR')) fs.mkdir('PATH/TO/DIR');
like image 92
Yan Foto Avatar answered Oct 01 '22 17:10

Yan Foto