I am working on an electron project which uses Monaco Editor.
To load a file I use this code:
dialog.showOpenDialog({}, (files) => {
if(files && files.length > 0) {
fs.readFile(files[0], 'utf8', (err, res) => {
if (!err) {
editor.setModel(monaco.editor.createModel(res, 'javascript'));
}
})
}
})
This issue is that I already know the location of the file and the filename that I need to load.
So my question is...how do I load the file without having the dialog popping up asking for the file?