Reading and Writing Files with Node.js | Node JS Beginners Tutorial

preview_player
Показать описание


(00:00) Intro
(00:05) Welcome
(00:15) Overview
(00:33) Use the NodeJS docs
(03:53) How to handle uncaught errors
(04:52) Async example
(06:01) Path module
(10:01) Nested operations
(11:31) Callback hell
(13:32) fsPromises
(16:02) Replace Callback hell with Async Await
(20:09) Readstream for large files
(21.25) Writestream for large files
(22:15) Stream data listener
(23:19) Piping data streams
(25:14) How to check if a file or directory exists

📚 References:

✅ Follow Me:

#node #js #files
Рекомендации по теме
Комментарии
Автор

It's refreshing to see a tutorial where someone mentions documentation they are using. Most of the times it's "let's put this absolutely cryptic line of code here because I said so".

chotabomjvonychi
Автор

This course is so underrated, thanks for this Dave!

codewithkin
Автор

Super useful.
8 minutes in and you've answered every question I had right now.
(JS noob who installed node for the first time this morning as an alternative to doing everything in dev tools. Been wondering for a while if i could read/write files. Kind of crazy how thrilling it is to be sitting here looking at a list of 20 freshly minted random numbers in a simple ol' text file your tutorial taught me how to create.)
Many Thanks, once again, for sharing your knowledge.
Will be checking out your full node tutorial for sure.

samdavepollard
Автор

learning how to handle system files is very useful when dealing with things such as logging, caching, loading/importing external files into the app (maybe exported from Excel as csv) and many other scenarios,

about the uncaught exception (or any similar event available in other languages), I tend to implement it at the final stage in my app development progress so I can immediately notice any exception may occurs (as I forgot to look at the console most of the time),
of course I'll be implementing it once my app functionalities are well tested so any error may occur could be due to unpredictable/Uncontrolled external causes (environment settings, server load/crash, file corruption, etc.. ), at this point it's good idea to log what happened there and maybe report it to the developer,

Thanks Dave for the great work and I hope to see you in the next video

ahmad-murery
Автор

Fantastic vanilla Node tutorial. Concise and practical. Thank you, Dave!

tfn
Автор

I applied this tutorial to read a JSon file and it worked well! Thank you Dave, you really made this task simple and easy to understand!

arturotrejo
Автор

This content is by far the best. Thank you for this labor of love. It's going to change my life.

dorian
Автор

Awesome Explanation.. In an easy to understand manner

aamirbinusman
Автор

Thanks for the explanation about why it's better to have the use appened file inside the write file function. I've seen it done before but didn't know why it might be useful. I didn't realize append file was capable of writing a new file also; so now it makes sense to have it operate 'after' write file.

TinyMaths
Автор

Hey, thanks for this! i am really insterested about how things work in a full developed web application, this thing really helped me!

devynity
Автор

I love your content so much! Looking forward to new Nodejs tutorial videos. Love from Vietnam <3

codie
Автор

The best channel ever! Thank you for the awesome tutorial! 💛

kostiantynkarzhanov
Автор

Great video sir you have explained fs module very clearly and in a very good way. Thanks a lot sir. 🙏🔥😊✅❤️

mma-dost
Автор

Just want to say, GREAT TUTORIAL!!!!, Thank you

RamanKumar-fvub
Автор

Thank you Dave Gray you're the best

yamillayicov
Автор

I loved this tutorial... Thank you Dave!

jennyaguilar
Автор

Awesome video Dave! Your video helped me.

daddyknowsbest
Автор

Loved the tutorial, it'd be nice if you could show us how to stream huge data from backend to frontend in a mern app.

baxtables
Автор

Best of the best of the best. Thanks you

TravinskiyVladislav
Автор

thanks so much for this helpful tutorial

abdelmonem