Opens file dialog gui in nodejs server side
Currently supports 64 bit architecture only
npm install node-file-dialog
The configuration supports following dialog types
directory
: Opens directory selection promptsave-file
: Opens save file promptopen-file
: Opens open file promptopen-files
: Opens open file prompt where multiple files can be selected
const dialog = require('node-file-dialog')
const config={type:'directory'}
dialog(config)
.then(dir => console.log(dir))
.catch(err => console.log(err))
It returns a promise with the list of selected files
[ '/path/to/selected/folder/or/files', ... ]
If nothing is selected, It throws an error
Error: Nothing selected