cosmiconfig icon indicating copy to clipboard operation
cosmiconfig copied to clipboard

Doesn't it parse ini format?

Open panlina opened this issue 6 years ago • 3 comments

I mean the traditional ini format, like:

a=b
c=d

It gives the plain string, instead of the parsed object, like {a: "b", c: "d"}.

panlina avatar Jun 25 '19 15:06 panlina

Unfortunately the 'ini' format isn't supported out of the box. Instead we support js, json, and yaml.

By default, Cosmiconfig will start where you tell it to start and search up the directory tree for the following:

a package.json property a JSON or YAML, extensionless "rc file" an "rc file" with the extensions .json, .yaml, .yml, or .js. a .config.js CommonJS module

To support the 'ini' format you will need a loader to handle it. It's possible someone has already written one, but I don't know of any and didn't find one off a quick search.

olsonpm avatar Jun 26 '19 19:06 olsonpm

OK. Thanks for the info.

panlina avatar Jun 27 '19 02:06 panlina

Maybe confinode would fit your needs…

sveyret avatar Feb 25 '20 12:02 sveyret

The .ini format is too niche to put into the default loaders. Therefore, I'm closing this.

d-fischer avatar Nov 13 '22 22:11 d-fischer