concept JSON in category node

This is an excerpt from Manning's book Getting MEAN with Mongo, Express, Angular, and Node.js 2ED.
MongoDB stores documents as BSON, which is binary JSON (JavaScript Serialized Object Notation). Don’t worry for now if you’re not fully familiar with JSON; check out the relevant section in appendix D. In short, JSON is a JavaScript way of holding data, which is why MongoDB fits so well into the JavaScript-centric MEAN stack!
The popularity of JSON as a data exchange format predates the development of Node by quite some time. JSON began to flourish as the ability of browsers to run complex JavaScript increased. Having a data format that was (almost) natively supported was extremely helpful and made life considerably easier for front-end developers.
The previous preferred data exchange format was XML. Compared with JSON, XML is harder to read at a glance, much more rigid, and considerably larger to send across networks. As you saw in the JSON examples, JSON doesn’t waste much space on syntax. JSON uses the minimum amount of characters required to accurately hold and structure the data, not a lot more.
When it comes to the MEAN stack, JSON is the ideal format for passing data through the layers of the stack. MongoDB stores data as binary JSON (BSON). Node and Express can interpret this natively and also push it out to Angular, which also uses JSON natively. Every part of the MEAN stack, including the database, uses the same data format, so you have no data transformations to worry about.

This is an excerpt from Manning's book Node.js in Practice.
Rather than passing lots of callbacks to a readable stream constructor function, which would be messy, you subscribe to the events you’re interested in. Streams can be piped together, so you could have one stream class that reads data from the network and then pipe it to a stream that transforms the data into something else. This could be data from an XML API that’s transformed into JSON, making it easier to work with in JavaScript.
Since we want to use it in our Node application, JSON would be a good format choice because it can be natively parsed in JavaScript and resembles native JavaScript objects. This is illustrated in figure 3.4.