cerbero90 / json-parser

🧩 Zero-dependencies lazy parser to read JSON of any dimension and from any source in a memory-efficient way.
MIT License
671 stars 11 forks source link

How is this different from halaxa/json machine? #2

Closed faizanakram99 closed 11 months ago

faizanakram99 commented 11 months ago

There is a already a package with 0 dependencies and over 3 million downloads doing more or less the same. How is this package different from it?

cerbero90 commented 11 months ago

Hi Faizan and thanks for your interest :)

JSON Machine is a fantastic project and I contributed to it in the past by letting JSON pointers iterate through nested arrays and fixing some bugs.

However it's not fully OOP, it's hard to debug and extend, runs extra loops and regex, works on limited JSON sources and its pointers aren't 100% accurate.

Don't get me wrong, I'm a fan of Filip and his hard work, but the points mentioned above and the need of extra functionalities (not easily implementable in JSON Machine) led me to the decision of creating my own parser.

The main difference between the two projects is that JSON Parser is able to parse JSONs of any dimension because it leverages recursive generators, whilst JSON Machine would run out of memory if a value is too large.

For completeness, here is a comprehensive list of the benefits of JSON Parser compared to JSON Machine:

faizanakram99 commented 11 months ago

Thank you for the detailed comparison