Use JSON in Node.js | Parse JSON in Node JS | Create and Read JSON File in Nodejs

Опубликовано: 20 Октябрь 2024
на канале: Stubborn Developers
3,702
51

#stubborndevelopers

In this video we will learn all about JSON in Node.js that how we can create JSON data into a JSON file and how we can read a JSON file in node js. Also we will convert JavaScript Object into JSON and we will parse JSON to JavaScript Object.

What is JSON.parse()
What is JSON.stringify()

JSON stands for JavaScript Object Notation. It is a lightweight data format that has become the defacto standard for the web. JSON can be represented as either a list of values, e.g. an Array, or a hash of properties and values, e.g. an Object.

Encoding and Decoding in JSON in Node.js
JavaScript provides 2 methods for encoding data structures to JSON and encoding JSON back to JavaScript objects and arrays. They are both available on the JSON object that is available in the global scope.

JSON.stringify takes a JavaScript object or array and returns a serialized string in the JSON format.
JSON.parse takes a JSON string and decodes it to a JavaScript data structure.

*********** Use fs module Synchronously ***********
   • File System Module fs in Node.js | No...  

*********** Use fs module Asynchronously ***********
   • Node.js Asynchronous File System Modu...  

*********** Node.JS Tutorial in English 2021 Playlist ***********
   • how to install node js  

*********** React.JS Tutorial in Hindi 2021 Playlist ***********
   • react js introduction in hindi