Node.js is a platform built on Chromes JavaScript runtime for easily building fast and scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices

- Read JSON data from disk
- Learn to use
fs
module to interact with the filesystem - Persist data to a JSON file
- Use
JSON.parse
andJSON.stringify
to convert data to and from JSON format
By the end of this tutorial you should be able to work with JSON files using Node’s built-in fs
module.
Say you have a customer.json file saved to disk that holds a record for a customer in your store.
As part of your store app, you want to access the customers address, and then update the order count after an order is placed.
In this tutorial, we are going to look at how to read and write to our customer.json file.
{
"name": "Mega Corp.",
"order_count": 83,
"address": "Infinity Loop Drive"
}