naviapps / create-nw-react-app

Create NW.js React apps with no build configuration.
MIT License
144 stars 14 forks source link

How to have access to the file system? #42

Open abbes-mebrouki opened 3 years ago

abbes-mebrouki commented 3 years ago

In case I want to use an SQLite database with my project, how can I get access to the file system. in other words how to set up SQLite support in a project created with ? And there is another thing, after creating a project with I get the usual file structure given by , the problem here how can I make changes to the window like title, width, position, and other properties?

zoeleu commented 3 years ago

const fs = require('fs') if I remember correctly.

acroyear commented 3 years ago

Yeah - the thing to think about is that everything available to a node.js "server" app is available in nw.js. Simply call the file system and path methods directly.

I would recommend using the promises versions, in order to not block the UI while the file system stuff is happening. nw.js has full access to async and await which makes the code a bit more readable, too.