What is JSON?
A JSON string is a text string that is written as JSON object notation (JSON) and can be used to store and exchange data. This means that it can be used with multiple programming methodologies as it is easily read and parsed by several different client-side and server-side interfaces. Since JSON is highly adaptable, it makes it a highly efficient method for storing information.
Why Use NodeJS with JSON?
As a result of NodeJS and MongoDB, a web standards architecture or RESTful API can be created; NodeJS is a lightweight framework handling the parsing of information between the client-side and the server, while ReactNative adds the user interface on top of NodeJS. In mobile application development, NodeJS offers very fast handling of a large number of queries. This is a great feature for mobile applications. HTTP requests and database updates can be handled using RESTful application programming interfaces. JSON when used with NodeJS makes for an impeccable way to handle AJAX-type requests.
What is an example of JSON?
An example of JSON looks like this:
{“name”:”Karenina”,”age”:”26″},
{“name”:”John”,”age”:”48″},
{“name”:”Jusco”,”age”:”10″}
Pros –
In addition to supporting hierarchical data, it is also smaller in size than XML and can be parsed into native Javascript objects, making it an ideal choice for applications.
There are numerous advantages of using JSON over CSV and XML as it offers the best features of both of them. It is highly compact and easy like CSV while allowing you to support hierarchical data as XML. Its size is two to three-time smaller than CSV.
Cons –
There are fewer APIs available to automatically convert JSON to native data structures because JSON is newer than XML. However, this trend is changing rapidly due to new APIs and plugins that support XML and JSON.
Conclusion
Generally, JSON offers the best data format. It is highly flexible, compact, and lightweight. So if you are to decide, you must pick JSON as compared to CSV and XML.