Verifique se existe o arquivo de elétrons se existe
if (fs.existsSync(`~/.config/myApp/bookmarks.json`)) {
console.log('exists')
} else {
console.log('does not')
}
QP2
if (fs.existsSync(`~/.config/myApp/bookmarks.json`)) {
console.log('exists')
} else {
console.log('does not')
}