If a string contains a .ini file data , How can I parse it in JavaScript ? Is there any JavaScript parser which will help in this regard?
here , typically string contains the content after reading a configuration file. (reading cannot be done through javascript , but somehow I gather .ini info in a string.)
Here's a function who's able to parse ini data from a string to an object! (on client side)
You could try the config-ini-parser, it's similar to python ConfigParser without I/O operations
It could be installed by npm or bower. Here is an example:
For more detail you could check the project main page or from the npm package page
I wrote a javascript function inspirated by node-iniparser.js
2017-05-10 updated: fix bug of keys contains spaces.
EDIT:
Sample of ini file read and parse