An excellent tutorial. And it's exactly what I was looking for as I am about to embark on writing a simple editor for a very specific json file. I will be the sole user and the file is not terribly large, so I am not concerned about multiple users editing the file at the same time. And it's great that you have a written version of this for reference. Thank you!
Thank you for the tutorial, it's very informative ))) Please consider using your IDE with a dark theme when making your videos, it's hard to watch this at night 😅
Very clearly explained, thanks for the help! I had trouble trying to push a new item into an array in a json document, and this cleared some things up for me
I've been wandering for hours now, looking for JSON read/file help in Node.js (newbie here). Loading JSON faking a web request/response just wasn''t for me and for the project I'm currently on, yet it seemed the only, or at least the "way more popular" way (why in the world? you already possess the *.json file locally... just wondering). I can't really describe how big is my wish to say "Thank you". Thank you for existing, this video is exactly what I needed.
The function jsonReader() was defined earlier in the video at ruclips.net/video/HrjC6RwEpt0/видео.html, you'll need to make sure that function exists before writing the update code. Hope that helps.
I think you would want to use fetch() if the .json file was served over HTTP and you had to request it from another server. And fs.readFile for files on the same filesystem.
Two different bits of information. The important piece here is that using something like `require('./file.json')` loads the file's content into the node.js memory cache and it's possible that subsequent calls will return the cached result instead of reading the file from disk again. `fs.readFile` will always ready the file from disk whenever it is executed.
I've not done it myself, but it looks like you could accomplish this with nodemailer.com/usage/. Using something like the jsonReader() function in this tutorial, and then instead of console.log() to output the data write a function that uses ndoemailer to send an email that contains the data you've read in.
An excellent tutorial. And it's exactly what I was looking for as I am about to embark on writing a simple editor for a very specific json file. I will be the sole user and the file is not terribly large, so I am not concerned about multiple users editing the file at the same time. And it's great that you have a written version of this for reference. Thank you!
I was searching for json read write whole day then found your vedio.......
Just 10 min but explained every thing😍
Bro.... What a teaching skill.... Cleared all doubts in single video👍
Your voice is sooo soothing
but vs code white theme is killing me
Finally after zapping over 2 tons of inconsistent fs module tutorials, i got he good one ! Damn it
Best tutorial ever.. Keep up the great work!
Thank you for the tutorial, it's very informative ))) Please consider using your IDE with a dark theme when making your videos, it's hard to watch this at night 😅
Underrated channel
Very good tutorial, consice and easy to understand! Thank you so much! 💛
Hey, just want to thank you for making this video tutorial. Cheers
You explained really clearly. Nice tutorial. Great work!
Very clearly explained, thanks for the help! I had trouble trying to push a new item into an array in a json document, and this cleared some things up for me
what happens if you actually have 2 or 3 json objects in the file? how do you handle to update them? can you share it with me?
Best Tutorial ever MADE
I've been wandering for hours now, looking for JSON read/file help in Node.js (newbie here). Loading JSON faking a web request/response just wasn''t for me and for the project I'm currently on, yet it seemed the only, or at least the "way more popular" way (why in the world? you already possess the *.json file locally... just wondering). I can't really describe how big is my wish to say "Thank you". Thank you for existing, this video is exactly what I needed.
Thanks for the wonderful explanation. Helped me alot.
Thank you for this great video.
Very clearly and simply explained. Thankyou.
Thanks amazing tutorial gained a new sub
Thanks for the sub!
You explained it quite clearly, thank you!
Nice tutorial, interested to watch you covering other topics too
Hey thanks Omar. What other topics in particular would you like to see?
@@heynode how do you actually handle this if you have 2 or more json object?
Thanks! Nice explaination
Really nice tutorial, thank you!
Splendid stuff.
Very nice example
Very nice.
Please make us learn the same thing in Typescript as well 🙏
Great tutorial. Thanks a ton.
Thank you bro, helped me alot.
Tutorial starting time show require file then without require system, you are show data??
Super easy example help nobody in practice
Great video, thanks!
Good video ! (why you use light mode? lmao )
very good information. Thanks for sharing.
tout ça c'est beau mais comment on fait pour utiliser les données dans un vrai programme javascript?
Can this NODE be used like js, without libraries buddy?
How can we parse chunks as valid JSON? What if we have a huge json file and want to make some logic for chunks?
great video. Thank you!
may i know how to convert a text file to json in nodejs
i am having problem in reading and writing it is saying file not exists only way i was able to read it using require() can any one help me
Thank you very much!
i need to put a type: module in json file but don't know how to do it
This error - ReferenceError: JSONReader is not defined at Object. - on Update code. :(
The function jsonReader() was defined earlier in the video at ruclips.net/video/HrjC6RwEpt0/видео.html, you'll need to make sure that function exists before writing the update code. Hope that helps.
You're the best!
How we can add data in json file without erasing/deleting the exist data on the json file
thank you help a lot !
Great and just great
Nice tutorial, just hated the light theme
How to do same with react native?
is fetch() not a good move to use to get data from json file?
I think you would want to use fetch() if the .json file was served over HTTP and you had to request it from another server. And fs.readFile for files on the same filesystem.
How do you do this on react?
But on build this is not working
does fs.readFile always read the current state of the file BECAUSE it's an async function?... or are those 2 separate pieces of information?
Two different bits of information. The important piece here is that using something like `require('./file.json')` loads the file's content into the node.js memory cache and it's possible that subsequent calls will return the cached result instead of reading the file from disk again. `fs.readFile` will always ready the file from disk whenever it is executed.
good job!
tip, use dark mode
Yeah lol
ReferenceError: jsonReader is not defined
EDIT: Nvm i just looked at tutorial on google(your video on website)
Hey thank you for these videos, is there a function i could write to send json data to my email ?
I've not done it myself, but it looks like you could accomplish this with nodemailer.com/usage/. Using something like the jsonReader() function in this tutorial, and then instead of console.log() to output the data write a function that uses ndoemailer to send an email that contains the data you've read in.
@@eojthebrave thanks Joe
@An A Count lol
🔥🔥🔥🔥 Thanks
i am not able to get address
07:00 fs.writeFile
perfect
감사합니당
good game
are you kiding with public?
I keep getting an error. Javascript is possible the worst programming language.
Thanks for your help :)