how to read json file in static oder assets folder
See original GitHub issueHi,
i tried to read an json file with my configurtion, but I can`t get the path to the assets or static folder. How can I do that?
regards
import path from 'path'
import { remote } from 'electron'
console.log("getAppPath:", remote.app.getAppPath())
const jsonPath = path.join(remote.app.getAppPath(), '/assets/content.json')
console.log(jsonPath);
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
java - How can I parse a local JSON file from assets folder into ...
First of all read the Json File from your assests file using below code. and then you can simply read this string return...
Read more >Java Android - Read JSON file from assets using Gson
You will need to create the assets folder inside src/main, together with java and res folder. Then put JSON file inside assets folder....
Read more >Node.js Tips — Read JSON, Serve Static Files, Sorting File ...
We use the express.static middleware to serve static files. Then we can access them from index.html , where we access the assets folder....
Read more >How to import Static Json File from assets folder in Angular in ...
... How to Import static json file in service from assets folder in AngularJoin this channel to get access to perks:https...
Read more >Read A JSON File From Assets in Angular - Better Programming
One way to read a JSON file from the assets folder in Angular is to use the import statement in your component. If...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
simply require the file
@SimulatedGREG am I missing some doc somewhere which explains how to make __static work? It is undefined in App.vue, background.js, and everywhere else I try. I cannot find any reference to it in my project folder.