Reputation: 304
I have a file structure like so:
ElectronAppExecutable.exe
File1.dll
File2.dll
File3.dll
Config.ini
How would I get my node executable to read a Config.ini file in the same folder?
Upvotes: 0
Views: 331
Reputation: 329
You would need to import a package to read files most commonly in node you would use the FS library. However, newer versions of electron might need you to flag node_packages as true to access them. < (Done some digging and this may not apply anymore or just happened in my use case)
Just to note FS reads the file as a string so you would need to parse values you need out of the config.ini or you can put your faith into a package like this > https://www.npmjs.com/package/ini .
Upvotes: 1