Officer_Narc
Officer_Narc

Reputation: 304

How do I read an ini file from a node executable(electron app)

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

Answers (1)

HugoDos
HugoDos

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

Related Questions