Working with JSON

One of the data types that you will most commonly work with when implementing Node.js web applications and services is JSON (JavaScript Object Notation). JSON is a very lightweight method to convert JavaScript objects into a string form and then back again. It works well when you need to serialize data objects when passing them from client to server, process to process, or stream to stream or when you’re storing them in a database.

There are several reasons to use JSON to serialize your JavaScript objects instead of using XML:

Image JSON is much more efficient and takes fewer characters.

Image Serializing/deserializing JSON is faster than serializing/deserializing XML.

Image JSON is easier to read from a developer’s perspective because its syntax is similar to that of JavaScript.

You might want to use XML instead of JSON for extremely complex objects or if you have XML/XSLT transforms already in place.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.171.64