File Handling in NodeJS

  Рет қаралды 112,654

Piyush Garg

Piyush Garg

Күн бұрын

Hey Everyone, In this video, we will look at file handling in NodeJS. We'll see how to create, write, read and delete files using FS module in NodeJS.
► Complete Full Stack Web Developer RoadMap 2023: • Complete Full Stack We...
► Master NodeJS Playlist: • Master NodeJS
Quick Links
Node.JS Website: nodejs.org/en/
Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. It allows developers to run JavaScript on the server side, creating server-side applications with JavaScript.
► My Website: www.piyushgarg...
My Gears
► My Girlfriend: amzn.to/3WD6FRp
► Apple MacBook Laptop: amzn.to/3WBJgQn
► Anker USB Hub: amzn.to/3GhZSr0
► Blue Yeti Microphone: amzn.to/3YKZ9FT
► External 27” Monitor: amzn.to/3Vp3xaO
► Logitech MK295 Wireless Keyboard and Mouse: amzn.to/3DuL1bB
► Seagate Expansion 1TB External HDD: amzn.to/3QMm5Q8
► Tripod: amzn.to/3S4OwK4
► Ring Light: amzn.to/3YLf8DR
Disclaimer: All the links above are affiliate links.
Social Links
► Twitter - / piyushgarg_dev
► LinkedIn - / piyushgarg195
Video Titles
What is NodeJS?
How does NodeJS Work?
File Handing NodeJS
FS Module NodeJS
Modules in NodeJS
Require Function in NodeJS
Exports in NodeJS
NodeJS in Hindi
Tags
#nodejs #javascript #developer #javascriptinhindi #webdevelopment #webapp #realtimeapp #serverside #nonblockingio #tech

Пікірлер: 107
@malikmubashir2597
@malikmubashir2597 8 ай бұрын
You're a really great teacher, I haven't seen such a detailed and clear explanation anywhere. Thanks a bunch!
@RakeshGupta-sn6rd
@RakeshGupta-sn6rd 6 ай бұрын
Saw many tutorials but none of them where better than you ... Need to say you are underrated tutor on KZbin...
@vocabpower8707
@vocabpower8707 25 күн бұрын
100% agree to this .♥
@dhruvipatel2935
@dhruvipatel2935 5 ай бұрын
Wow. Just 3 videos and i am loving node. You explain it so fluently. Had a habit of making notes for help in future but you created permanent notes in my head:) This tutorial is the best‼️
@kunalsharma1936
@kunalsharma1936 Ай бұрын
bhiaya aap ne bhot help ki hai meri Har concept me aap se Javascript, react or next padhi thi ab backend start kar rha hu aap ko dil se thank you❤
@samarbhao4703
@samarbhao4703 7 ай бұрын
You realy explained it well. Your way of giving clearification is so good..
@muhammadtahir-f6n
@muhammadtahir-f6n 7 ай бұрын
amazing teacher, I'm following you to learn NodeJS.
@yashwantkumar9621
@yashwantkumar9621 Жыл бұрын
I completed one playlist of nodejs... But there are no detailed like this... Thanks
@VSS2002
@VSS2002 2 ай бұрын
I am actually getting curious about learning more in Nodejs after watching your tutorials, you explain it in very easy way. Thank you so much , keep up the good work
@balajimutyala3035
@balajimutyala3035 2 ай бұрын
A very big thanks, bro. You're explaining each topic in the finest way.
@mithil26
@mithil26 18 күн бұрын
A Genuine Thank you, I've been struggling to understand node js and express. up to this video I understood everything and hope express will also be as good as node explanation. But also same thing is happing in react also i hope i can understand react later. Can anyone suggest best react tutorials? (except codewithharry) Again, Thanks Piyush Bhai ❤
@RamRider-h8w
@RamRider-h8w 2 ай бұрын
hey there can anyone tell me which snippet to install for node js as There is no suggestion is showing in visual code
@hrithikroy9398
@hrithikroy9398 8 ай бұрын
Awesome course better than many paid courses also i have a question which vs code theme are you using? Also can you make a video on your vs code setup key binding and extension you used that will be fun to watch waiting for you reply🙌🏽❤️
@Hiteshpaliwal01
@Hiteshpaliwal01 6 ай бұрын
This is Complete beginner friendly to advance concepts and very deep series. ✅
@YashSingh-wv3yx
@YashSingh-wv3yx 2 күн бұрын
00:04 NodeJS provides file handling capabilities for creating, reading, and interacting with files. 02:38 Understanding synchronous and asynchronous file handling in NodeJS 04:55 Understanding file system in NodeJS and different types of tasks 06:58 File handling in NodeJS involves reading and decoding different types of files. 08:59 File handling in NodeJS involves synchronous and asynchronous operations with file reading and writing. 11:05 NodeJS file handling allows appending, writing and creating log files for monitoring purposes. 13:43 File handling in NodeJS allows creating, copying, and deleting files 16:01 File Handling in NodeJS involves various file operations. 18:07 Understanding file system in NodeJS Crafted by Merlin AI.
@marjukerazi1089
@marjukerazi1089 2 ай бұрын
your turorials are one of the best. please we need best practices and architecture use in node project tutorial.
@whatever6632
@whatever6632 Ай бұрын
Literally this is the only playlist to become master of node. Js ❤❤❤wow yrrr what a playlist 🥰🥰😘😘😘
@NeerajSingh-it3sm
@NeerajSingh-it3sm Ай бұрын
amazing and detailed Explanation..Thank you for providing in-depth knowledge..Keep posting and keep guiding.
@वृषालीहळदणकर
@वृषालीहळदणकर 3 ай бұрын
Thanks for your videos.. your narration is excellent
@weforyouweb1165
@weforyouweb1165 Жыл бұрын
You explanation is superb bro
@RakeshMishra-dj3sb
@RakeshMishra-dj3sb 2 ай бұрын
your way of teaching is awesome ,i just loved it .
@masteradvisor594
@masteradvisor594 6 ай бұрын
sir can you make angular for beginners series your way of teaching is too good
@RajCreationAA
@RajCreationAA 8 ай бұрын
Thank you so much Bhai for providing this level of content for free ❤
@vedanshpandey3738
@vedanshpandey3738 6 ай бұрын
your way of explanation is too good♥♥♥♥👍👍👍👍
@maneeta9207
@maneeta9207 9 ай бұрын
This course is better then pain courses ... Glad i found it..
@priyamv5508
@priyamv5508 4 ай бұрын
Make more videos on JavaScript projects and nodejs projects
@l-_._-l
@l-_._-l 7 ай бұрын
we can almost anything related to file e.g create edit delete these are not available in normal js const fs = require("fs") there are two types of commands for file handling sync and async // sync can return value that we can store in a variable const data = fs.readFileSync("file.txt", "utf8"); console.log(data); // sync requires a try and catch to handle error const fs = require('node:fs'); try { const stats = fs.statSync('/Users/joe/test.txt'); } catch (err) { console.error(err); } // async can't return value so we can't store it in a variable fs.readFile("file.txt", "utf8", (err, data) => { console.log(data); }); // async needs a call back where we can handle error const fs = require('node:fs'); fs.stat('/Users/joe/test.txt', (err, stats) => { if (err) { console.error(err); } // we have access to the file stats in `stats` });
@code4js
@code4js 4 ай бұрын
thanks yarr
@shubhammishra7135
@shubhammishra7135 4 ай бұрын
good and well done explain
@priyamv5508
@priyamv5508 4 ай бұрын
Your video are amazing; Please share link of your codes also
@divyanshsharma673
@divyanshsharma673 Ай бұрын
87K people watched, but only 1.7K liked ! Hey people, if this course is free, it doesn't mean it's not worthy..this course is much better than many paid ones.
@CodingIQ
@CodingIQ 19 күн бұрын
Now that i learn File Handling from you. Its time to post a video on my youtube channel to make sure i understand it well enough. Thanks sir.
@saurabhmaurya4199
@saurabhmaurya4199 18 күн бұрын
can you tell which vs code extension he is using for node js
@AdityaSharma-fc1sx
@AdityaSharma-fc1sx 18 күн бұрын
@@saurabhmaurya4199 yes bro I also want to know which extension is it
@KashifAli-ws4ow
@KashifAli-ws4ow 4 ай бұрын
very very Good And beginner level content very easy to learn with piyush
@jaganmohan2198
@jaganmohan2198 27 күн бұрын
Thanks piyush for really helpful tutorial
@satyamjain0655
@satyamjain0655 23 күн бұрын
Really good explanation
@dhruvsolanki4473
@dhruvsolanki4473 4 ай бұрын
Really good explanation.
@not_amanullah
@not_amanullah 6 ай бұрын
this is helpful ❤
@amolbodkhe742
@amolbodkhe742 Жыл бұрын
Simple word explanation. 🎉🎊
@RohitKatkar-yl6eo
@RohitKatkar-yl6eo 4 ай бұрын
One of the best Node.js playlist🔥
@SSDas2024
@SSDas2024 5 ай бұрын
Thank You Sir
@lakshaysharma8364
@lakshaysharma8364 Жыл бұрын
thank you very much bro continue making easy tutorials pls
@PrathamSahu1
@PrathamSahu1 Жыл бұрын
Nice Explanation
@BhagatBhutale..
@BhagatBhutale.. 9 күн бұрын
Extension konsa use kr rhe ho fs ke liy ...Please
@Sinha.ritesh
@Sinha.ritesh 7 ай бұрын
nicely explained ... Thanku
@nishantsingh2703
@nishantsingh2703 5 ай бұрын
amazing
@techy912
@techy912 Ай бұрын
Bhaiya you are the best. 🏆🏆
@Hare_Krishna143
@Hare_Krishna143 Ай бұрын
You are explanation to good 👍
@ADB29_GolamRabbani
@ADB29_GolamRabbani 26 күн бұрын
thank you so much bro 💕
@ArunKumar_237
@ArunKumar_237 2 ай бұрын
super I am enjoying learning. Thanks
@parmjeetchauhan8984
@parmjeetchauhan8984 Ай бұрын
hey im preparing for MERN stack. right now i have completed js and react. can you guide me that do this node js serice is beneficial for me as in a queue of javascript-react,node js, express -mongo db
@bhavikbacchewar5811
@bhavikbacchewar5811 Ай бұрын
is it compulsory to write callback function in async writefile
@RJ14RAJASTHAN
@RJ14RAJASTHAN 2 ай бұрын
yaar bro kya padhate ho maja aa gya
@mandeepsingh2718
@mandeepsingh2718 7 ай бұрын
Pta nhi mujhe kyun lag raha hai yeh banda mujhe node.js sikha k chodega....😊 After wondering many channels (like code with harry, coderdost) i am on right place.....thanks bhai❤❤❤
@RakeshGupta-sn6rd
@RakeshGupta-sn6rd 6 ай бұрын
Just subscribed your Channel and exploring more contents of yours
@Pannu__Vibes
@Pannu__Vibes 4 ай бұрын
Thanku for such a nice explanation!
@spdwivedi5925
@spdwivedi5925 5 ай бұрын
Badhiya lecture tha
@VikasSharma-kc2oc
@VikasSharma-kc2oc Жыл бұрын
Awesome
@2ameridiem
@2ameridiem 4 ай бұрын
can we use the fs module to access any file on our system? or is it just for the files present in our current directory?
@noobcoder1687
@noobcoder1687 Жыл бұрын
bro, can you please write code in the ES6 way, since I am just start learning , I want to start with the best practice in place. Also can you show everything in class way, how people use them in production. Please talk about socket API as well.. I tried the P2P project, google meet like conferencing tutorial of yours and find it difficult. So, if you kindly talk about the basics, then that would be real help
@piyushgargdev
@piyushgargdev Жыл бұрын
Don't Worry! We are going to cover each and everything in this playlist and make super easy for you to understand. After this playlist you'll be able to follow P2P as well with ease.
@CodingHobby-x6j
@CodingHobby-x6j 6 ай бұрын
zabardast🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥
@team_fantasy672
@team_fantasy672 6 ай бұрын
Nice explanation 🔥
@Shyambond00713
@Shyambond00713 2 ай бұрын
what is difference between npm run XXX and npm XXX sir?
@zen.ali238
@zen.ali238 Ай бұрын
npm run xxx used to run command from package.json(scripts) meanwhile npm xxx used to run built in npm commands.
@jiminaaa1993
@jiminaaa1993 7 ай бұрын
Very nice explanation...
@pavankulkarni6007
@pavankulkarni6007 Жыл бұрын
badiya explaination bro
@shivamasati
@shivamasati 10 ай бұрын
Great content sir!
@yashgaud4845
@yashgaud4845 Ай бұрын
bro i dont know how but when I watch videos form this channel the video is always buffering and when I go a bit forward, it starts working! and it stops again
@vinaykumar-qq9wq
@vinaykumar-qq9wq 7 ай бұрын
Can some one tell any additional plugins to be installed to get intellisense suggestions. I'm not getting any of suggestions for objects created like fs object. Please suggest
@SumitKumar-g1n5f
@SumitKumar-g1n5f 8 ай бұрын
best quality content for free
@ekasbajaj6027
@ekasbajaj6027 7 ай бұрын
Bro mereme sare suggestions show nhi hote mujhe pura likhna pdta h fs.writefile pura likhne me even control space se bhi nhi hote....any suggestions kese theek ho skta h
@nobody20022
@nobody20022 Ай бұрын
Summary: Create file writeFileSync writeFile For read a file readFileSync readFile = expect call back func append in file appendFileSync Copy file cpSync For delete file unlinkSync For Statics statSync For creating a folder mkdirSync
@eternal423
@eternal423 5 ай бұрын
Thank you❤
@dhritika-j2t
@dhritika-j2t Ай бұрын
just wow
@inderjeet09
@inderjeet09 Жыл бұрын
Bro there is a issue when using appendSync function your file appends the given text every time you run your code but in my case I am using same code but my text is appended only once and then remains same even if I run it 5 times Please describe why is it so.
@mr.incognito611
@mr.incognito611 6 ай бұрын
you need to comment out the writeFileSync and readFileSync lines . The reason is everytime the file.js is getting executed the writeFIleSync is deleting the previous demo.txt and creating a new demo.txt with the content passed to it and then it's appending the content of the appendFileSync .
@pratikshanikam2503
@pratikshanikam2503 4 ай бұрын
explained very clearly thank you sir!!!!!!!
@HamidRaza-di1cg
@HamidRaza-di1cg 6 ай бұрын
require keyword not appearing in code completion in VS code please help me
@not_amanullah
@not_amanullah 6 ай бұрын
thanks ❤
@shamraizkhan3029
@shamraizkhan3029 Ай бұрын
I don't have auto suggestion option like the sir can someone tell which extension it is?
@AdityaSharma-fc1sx
@AdityaSharma-fc1sx 18 күн бұрын
Did you find the solution?
@SulavGhimireeee
@SulavGhimireeee 9 ай бұрын
Thanks bro
@afzalhamdulay
@afzalhamdulay 7 ай бұрын
what does {recursive : true} do?
@mrgtxgamerz1
@mrgtxgamerz1 Жыл бұрын
💥💥
@k.p.creation2339
@k.p.creation2339 Ай бұрын
Sir mere vs code par ye automatic suggestions ni aa rahe hai file.readsync aesa
@AdityaSharma-fc1sx
@AdityaSharma-fc1sx 18 күн бұрын
Did you find the solution?
@mysteriousocean6198
@mysteriousocean6198 7 ай бұрын
Lovely
@venkat-1710
@venkat-1710 5 ай бұрын
when writing fs.writeFileSync("./test.text") it is showing error as module not found and writeFileSync is not a function please help
@DineshKumar-h3w8h
@DineshKumar-h3w8h 2 ай бұрын
npm i fs
@simplsurvival
@simplsurvival Ай бұрын
getting error Error: Cannot find module 'C:\Users\iamyo\OneDrive\Desktop\NodeJs\file.js'
@simplsurvival
@simplsurvival Ай бұрын
solved now
@advaitgraut
@advaitgraut 5 ай бұрын
can you please provide the source code as well for your videos
@VikasKumar-mw9ze
@VikasKumar-mw9ze Жыл бұрын
can you please provide the github link of these code files
@VishalSingh-er2bl
@VishalSingh-er2bl 10 ай бұрын
just wow...
@prasadsontakke3905
@prasadsontakke3905 8 ай бұрын
fs.writeFilesync("./test.txt", "Hello world") ^ TypeError: fs.writeFilesync is not a function
@techiji1645
@techiji1645 Ай бұрын
anyone have node js handwritten notes
@genzsubh
@genzsubh 6 ай бұрын
8:19 Galt bol diye h vo.. WriteFile sync nhi h vo.. Async hi hai hai na
@Adarsh_agrahari
@Adarsh_agrahari 11 ай бұрын
👍👍
@ShivendraPratap524
@ShivendraPratap524 Жыл бұрын
Sir new video kab tak upload karenge aap
@piyushgargdev
@piyushgargdev Жыл бұрын
Done :)
@amankumar3639
@amankumar3639 6 ай бұрын
👍👍👍👍👍👍👍
@bunnytheweebster
@bunnytheweebster 9 ай бұрын
vid-5 ✅
@deepakmaharana125
@deepakmaharana125 5 ай бұрын
53 Comments 53 Comments 53 Comments 53 Comments 53 Comments
@prabhatdeshmukh9592
@prabhatdeshmukh9592 10 ай бұрын
You're a really great teacher, I haven't seen such a detailed and clear explanation anywhere. Thanks a bunch!
@HEMANTKUMAR-wx6yv
@HEMANTKUMAR-wx6yv 8 ай бұрын
amazing
How NodeJS Works?
14:23
Piyush Garg
Рет қаралды 132 М.
Modules in NodeJS
15:25
Piyush Garg
Рет қаралды 123 М.
The CUTEST flower girl on YouTube (2019-2024)
00:10
Hungry FAM
Рет қаралды 55 МЛН
отомстил?
00:56
История одного вокалиста
Рет қаралды 7 МЛН
iPhone or Chocolate??
00:16
Hungry FAM
Рет қаралды 29 МЛН
How to use read and write streams in node.js for BIG CSV files
11:00
fs (File System) Module in Node JS
9:38
Telusko
Рет қаралды 100 М.
Building HTTP Server in NodeJS
17:56
Piyush Garg
Рет қаралды 126 М.
100+ Web Development Things you Should Know
13:18
Fireship
Рет қаралды 1,5 МЛН
DHH - Ruby on Rails, 37signals, and the future of web development
1:09:57
Advance logging with Morgan and Winston
18:24
Hitesh Choudhary
Рет қаралды 13 М.
How Versioning Works in NodeJS?
21:10
Piyush Garg
Рет қаралды 59 М.
What are Cookies in NodeJS?
30:35
Piyush Garg
Рет қаралды 62 М.
What is REST API?
15:41
Piyush Garg
Рет қаралды 114 М.
The CUTEST flower girl on YouTube (2019-2024)
00:10
Hungry FAM
Рет қаралды 55 МЛН