Some while ago I started learning Vue.js and a short while after, I started a bigger project, not keeping in mind, that Javascript has limited options to interact with the local file system
I set up the project via vue-cli, so I have to start the website via npm start…
However using a local file as a database is a little less clear of an answer depending on what you're trying to accomplish. If the user is creating their own local database for while they use the app, this would work (as long as the user only uses the app from that device).
But for a database that connects to other users you might want to look into Supabase or Firebase or CouchDb combined with PouchDb if you're interested in hosting the Database yourself :)
Hello, thank you for your answer. But in the proposals it gives it does not write to a file. I have a file and I need to inject my data from the program to my file
Yes the database I will use it only when the program is running
The Blob and Electron fs methods both will create a file - it's just a matter of saving the file to the location where your app is expecting it to be 🙂
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
This StackOverflow question should help with the creation of a JSON file:
Some while ago I started learning Vue.js and a short while after, I started a bigger project, not keeping in mind, that Javascript has limited options to interact with the local file system I set up the project via vue-cli, so I have to start the website via
npm start
…However using a local file as a database is a little less clear of an answer depending on what you're trying to accomplish. If the user is creating their own local database for while they use the app, this would work (as long as the user only uses the app from that device).
But for a database that connects to other users you might want to look into Supabase or Firebase or CouchDb combined with PouchDb if you're interested in hosting the Database yourself :)
Hello, thank you for your answer. But in the proposals it gives it does not write to a file. I have a file and I need to inject my data from the program to my file
Yes the database I will use it only when the program is running
The Blob and Electron
fs
methods both will create a file - it's just a matter of saving the file to the location where your app is expecting it to be 🙂