How to save data to JSON file

preview_player
Показать описание
A video on how to change JavaScript objects to a JSON format and then save to a json file.
Also creating a function that can be used more than once for different JS object saving to different json files.

00:00 Intro
00:21 Part 1 - Creating a function to save JS object to json file
03:42 Testing function
04:39 Explaining why to adapt the function
05:05 Part 2 - Adapting Function
05:37 Testing function
Рекомендации по теме
Комментарии
Автор

Great video up until the end, those end cards were put exactly where the code is and didn't let me see the final result

baterista
Автор

Very helpful video, can you please explain how to save data to specific location in json

rishabh
Автор

Hi, Great video - Really helped me out. What would I need to do if I want to wrap all of the JSON stored in the file in an array ie between [ ] ?

marklane
Автор

Good video man, keep up the good work 👍🏻

roryoconnor
Автор

I'm trying the same approach but I get an error stating "require" not defined. I'm using line for line like you have it but still getting that error.

metifu
Автор

i want to store the data into same file how's that going to work??
say i have multiple data to store into single JSON file

dheerajgakkampudi
Автор

Ugh _ this requires node and _ how do I do that?

BillBrutzman
Автор

where did you import fs? mine is red i have nodejs installed why do you not get "const { finished } = require('stream')" when you put finished after jsonData WTF is going on lol this all works some how for you and yet on my side its like were not even using the same language hahaha there has to be something im missing anyways it looks good i just wish it worked for me
update it works now once again this was great i just couldn't get it to work for a bit lol

suibhnesweeney
Автор

Is there a way to do this without nodejs?

thebulletkin
Автор

Hi, great tutorial!! Could you please help me out how to send data from ejs or client side js to server side js Node.js? Have been stuck on this forever. Would really appreciate your help!!

swatilekha_roy
Автор

How can I search the data in json file?

scottnguyen
Автор

Hi, I'm getting the following error while working on Write on Json file via Javascript

Uncaught ReferenceError: require is not defined


Is there any file do I need to import?

KrushalMahajan
Автор

hello sir, ...

can u suggest me a way..
like...
whenever from user end..interacting with the web page..

the user pefers to upload a .json file into react from <input type='file' />

then...how to develop a code for taking that user uploaded .json file and set into database and display them in the web page.?


please help..

thanks in advance.

PavanKumar-uxdq
Автор

hii do i need this express library to make that work?

agu
Автор

i got error "writeFile is not a function"

marclouiecabigas