Leonidas-from-XIV / node-xml2js

XML to JavaScript object converter.
MIT License
4.88k stars 604 forks source link

addition of arrayFields #632

Closed SaravanaS1358 closed 3 years ago

SaravanaS1358 commented 3 years ago

Added arrayFields to enable array even if there is one value. This is to maintain the consistency of JSON structure

krkestner commented 2 years ago

I dont see any documentation on the front page for arrayFields. Can you provide an example? I'm hoping this will help with the issue of making only certain items an array vs "all or nothing". Thanks.

liudonghua123 commented 1 year ago

I would like this pr merged, I really need arrayFields or some similar options.

see also https://github.com/Leonidas-from-XIV/node-xml2js/issues/210, https://github.com/Leonidas-from-XIV/node-xml2js/issues/489

liudonghua123 commented 1 year ago

I found another lib which supports this feature. See https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/docs/v4/2.XMLparseOptions.md#isarray.