November 2019
Beginner
436 pages
8h 52m
English
In this section, we're going to send the document to the main process. Follow these steps to do so:
const { Menu, BrowserWindow, dialog, ipcMain } = require('electron');
Now, we need to implement the saveFile function. You may have done this already in Chapter 2, Building a Markdown Editor.
function saveFile(contents) { const window = BrowserWindow.getFocusedWindow(); const options = { title: 'Save markdown file', filters: [ { name: 'MyFile', extensions: ['md'] } ] }; dialog.showSaveDialog(window, options, filename => { if (filename) { ...Read now
Unlock full access