W
W
Wasya UK2019-04-04 18:55:35
JavaScript
Wasya UK, 2019-04-04 18:55:35

How to use fs in electron?

Created a simple application in electron. But it just inserts a .html page, how do you use the fs module and worker_threads then? Thought to use webpack, but will worker_threads work? I remember trying to connect fs via webpack, but always getting an error. How to make a desktop application using fs?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
grinat, 2019-04-04
@grinat

Same as usual in node. There are two modules, one main, it is under the node (new BrowserWindow starts in it), the other renderer, this is what is displayed to the user in chromium, use fs in main, a regular html page in the renderer, they can communicate with each other through events. Through webpack, it only makes sense to collect what will be displayed in the renderer.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question