File Handling in NodeJS

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ก.ย. 2024
  • 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

ความคิดเห็น • 105

  • @RakeshGupta-sn6rd
    @RakeshGupta-sn6rd 6 หลายเดือนก่อน +24

    Saw many tutorials but none of them where better than you ... Need to say you are underrated tutor on TH-cam...

    • @vocabpower8707
      @vocabpower8707 8 วันที่ผ่านมา

      100% agree to this .♥

  • @malikmubashir2597
    @malikmubashir2597 8 หลายเดือนก่อน +7

    You're a really great teacher, I haven't seen such a detailed and clear explanation anywhere. Thanks a bunch!

  • @dhruvipatel2935
    @dhruvipatel2935 4 หลายเดือนก่อน +6

    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❤

  • @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

  • @mithil26
    @mithil26 วันที่ผ่านมา

    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 ❤

  • @CodingIQ
    @CodingIQ 2 วันที่ผ่านมา

    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 วันที่ผ่านมา

      can you tell which vs code extension he is using for node js

    • @AdityaSharma-fc1sx
      @AdityaSharma-fc1sx วันที่ผ่านมา

      @@saurabhmaurya4199 yes bro I also want to know which extension is it

  • @yashwantkumar9621
    @yashwantkumar9621 ปีที่แล้ว +16

    I completed one playlist of nodejs... But there are no detailed like this... Thanks

  • @jaganmohan2198
    @jaganmohan2198 10 วันที่ผ่านมา

    Thanks piyush for really helpful tutorial

  • @user-sg7pp7bv4l
    @user-sg7pp7bv4l 6 หลายเดือนก่อน +3

    amazing teacher, I'm following you to learn NodeJS.

  • @whatever6632
    @whatever6632 27 วันที่ผ่านมา

    Literally this is the only playlist to become master of node. Js ❤❤❤wow yrrr what a playlist 🥰🥰😘😘😘

  • @Hitesh_sigma
    @Hitesh_sigma 6 หลายเดือนก่อน +1

    This is Complete beginner friendly to advance concepts and very deep series. ✅

  • @balajimutyala3035
    @balajimutyala3035 หลายเดือนก่อน

    A very big thanks, bro. You're explaining each topic in the finest way.

  • @samarbhao4703
    @samarbhao4703 7 หลายเดือนก่อน +2

    You realy explained it well. Your way of giving clearification is so good..

  • @marjukerazi1089
    @marjukerazi1089 2 หลายเดือนก่อน

    your turorials are one of the best. please we need best practices and architecture use in node project tutorial.

  • @l-_._-l
    @l-_._-l 7 หลายเดือนก่อน +4

    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 3 หลายเดือนก่อน

      thanks yarr

  • @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.

  • @maneeta9207
    @maneeta9207 8 หลายเดือนก่อน +1

    This course is better then pain courses ... Glad i found it..

  • @NeerajSingh-it3sm
    @NeerajSingh-it3sm หลายเดือนก่อน

    amazing and detailed Explanation..Thank you for providing in-depth knowledge..Keep posting and keep guiding.

  • @user-be4kh9cg3k
    @user-be4kh9cg3k 2 หลายเดือนก่อน +1

    Thanks for your videos.. your narration is excellent

  • @RakeshMishra-dj3sb
    @RakeshMishra-dj3sb 2 หลายเดือนก่อน

    your way of teaching is awesome ,i just loved it .

  • @mandeepsingh2718
    @mandeepsingh2718 6 หลายเดือนก่อน +1

    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❤❤❤

  • @vedanshpandey3738
    @vedanshpandey3738 6 หลายเดือนก่อน +1

    your way of explanation is too good♥♥♥♥👍👍👍👍

  • @priyamv5508
    @priyamv5508 3 หลายเดือนก่อน +3

    Make more videos on JavaScript projects and nodejs projects

  • @masteradvisor594
    @masteradvisor594 5 หลายเดือนก่อน +1

    sir can you make angular for beginners series your way of teaching is too good

  • @shubhammishra7135
    @shubhammishra7135 4 หลายเดือนก่อน +1

    good and well
    done explain

  • @satyamjain0655
    @satyamjain0655 5 วันที่ผ่านมา

    Really good explanation

  • @RajCreationAA
    @RajCreationAA 7 หลายเดือนก่อน +1

    Thank you so much Bhai for providing this level of content for free ❤

  • @KashifAli-ws4ow
    @KashifAli-ws4ow 4 หลายเดือนก่อน

    very very Good And beginner level content very easy to learn with piyush

  • @RohitKatkar-yl6eo
    @RohitKatkar-yl6eo 4 หลายเดือนก่อน

    One of the best Node.js playlist🔥

  • @Hare_Krishna143
    @Hare_Krishna143 หลายเดือนก่อน

    You are explanation to good 👍

  • @weforyouweb1165
    @weforyouweb1165 ปีที่แล้ว +3

    You explanation is superb bro

  • @RJ14RAJASTHAN
    @RJ14RAJASTHAN หลายเดือนก่อน

    yaar bro kya padhate ho
    maja aa gya

  • @dhruvsolanki4473
    @dhruvsolanki4473 4 หลายเดือนก่อน +1

    Really good explanation.

  • @hrithikroy9398
    @hrithikroy9398 8 หลายเดือนก่อน +1

    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🙌🏽❤️

  • @pratikshanikam2503
    @pratikshanikam2503 3 หลายเดือนก่อน

    explained very clearly thank you sir!!!!!!!

  • @priyamv5508
    @priyamv5508 3 หลายเดือนก่อน +2

    Your video are amazing; Please share link of your codes also

  • @lakshaysharma8364
    @lakshaysharma8364 ปีที่แล้ว +1

    thank you very much bro continue making easy tutorials pls

  • @techy912
    @techy912 25 วันที่ผ่านมา

    Bhaiya you are the best. 🏆🏆

  • @user-wm7rf1dl3n
    @user-wm7rf1dl3n 8 วันที่ผ่านมา

    thank you so much bro 💕

  • @SSDas2024
    @SSDas2024 5 หลายเดือนก่อน +1

    Thank You Sir

  • @ArunKumar_237
    @ArunKumar_237 2 หลายเดือนก่อน

    super I am enjoying learning. Thanks

  • @Sinha.ritesh
    @Sinha.ritesh 6 หลายเดือนก่อน +1

    nicely explained ... Thanku

  • @amolbodkhe742
    @amolbodkhe742 ปีที่แล้ว +1

    Simple word explanation. 🎉🎊

  • @not_amanullah
    @not_amanullah 5 หลายเดือนก่อน +1

    this is helpful ❤

  • @nishantsingh2703
    @nishantsingh2703 4 หลายเดือนก่อน +1

    amazing

  • @Pannu_Short_Vibes
    @Pannu_Short_Vibes 4 หลายเดือนก่อน

    Thanku for such a nice explanation!

  • @PrathamSahu1
    @PrathamSahu1 ปีที่แล้ว +2

    Nice Explanation

  • @RamRider-h8w
    @RamRider-h8w หลายเดือนก่อน +1

    hey there can anyone tell me which snippet to install for node js as There is no suggestion is showing in visual code

  • @spdwivedi5925
    @spdwivedi5925 5 หลายเดือนก่อน

    Badhiya lecture tha

  • @RakeshGupta-sn6rd
    @RakeshGupta-sn6rd 6 หลายเดือนก่อน

    Just subscribed your Channel and exploring more contents of yours

  • @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

  • @jiminaaa1993
    @jiminaaa1993 6 หลายเดือนก่อน

    Very nice explanation...

  • @user-yi3tv1kp7w
    @user-yi3tv1kp7w 8 หลายเดือนก่อน

    best quality content for free

  • @noobcoder1687
    @noobcoder1687 ปีที่แล้ว +1

    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  ปีที่แล้ว +6

      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.

  • @parmjeetchauhan8984
    @parmjeetchauhan8984 20 วันที่ผ่านมา

    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

  • @Shyambond00713
    @Shyambond00713 2 หลายเดือนก่อน +2

    what is difference between npm run XXX and npm XXX sir?

    • @zen.ali238
      @zen.ali238 13 วันที่ผ่านมา +1

      npm run xxx used to run command from package.json(scripts) meanwhile npm xxx used to run built in npm commands.

  • @team_fantasy672
    @team_fantasy672 6 หลายเดือนก่อน

    Nice explanation 🔥

  • @bhavikbacchewar5811
    @bhavikbacchewar5811 หลายเดือนก่อน

    is it compulsory to write callback function in async writefile

  • @pavankulkarni6007
    @pavankulkarni6007 ปีที่แล้ว

    badiya explaination bro

  • @user-hg1xv2lh7o
    @user-hg1xv2lh7o 5 หลายเดือนก่อน

    zabardast🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥🔥

  • @shivamasati
    @shivamasati 9 หลายเดือนก่อน

    Great content sir!

  • @VikasSharma-kc2oc
    @VikasSharma-kc2oc ปีที่แล้ว +2

    Awesome

  • @eternal423
    @eternal423 4 หลายเดือนก่อน

    Thank you❤

  • @2ameridiem
    @2ameridiem 3 หลายเดือนก่อน

    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?

  • @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

  • @dhritika-j2t
    @dhritika-j2t หลายเดือนก่อน

    just wow

  • @not_amanullah
    @not_amanullah 5 หลายเดือนก่อน

    thanks ❤

  • @SulavGhimireeee
    @SulavGhimireeee 8 หลายเดือนก่อน

    Thanks bro

  • @shamraizkhan3029
    @shamraizkhan3029 14 วันที่ผ่านมา

    I don't have auto suggestion option like the sir can someone tell which extension it is?

  • @yashgaud4845
    @yashgaud4845 26 วันที่ผ่านมา

    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

  • @inderjeet09
    @inderjeet09 ปีที่แล้ว +1

    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 .

  • @HamidRaza-di1cg
    @HamidRaza-di1cg 5 หลายเดือนก่อน

    require keyword not appearing in code completion in VS code please help me

  • @ekasbajaj6027
    @ekasbajaj6027 6 หลายเดือนก่อน

    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

  • @simplsurvival
    @simplsurvival 29 วันที่ผ่านมา

    getting error Error: Cannot find module 'C:\Users\iamyo\OneDrive\Desktop\NodeJs\file.js'

  • @afzalhamdulay
    @afzalhamdulay 6 หลายเดือนก่อน

    what does {recursive : true} do?

  • @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

  • @mrgtxgamerz1
    @mrgtxgamerz1 ปีที่แล้ว +1

    💥💥

  • @mysteriousocean6198
    @mysteriousocean6198 6 หลายเดือนก่อน

    Lovely

  • @k.p.creation2339
    @k.p.creation2339 หลายเดือนก่อน

    Sir mere vs code par ye automatic suggestions ni aa rahe hai file.readsync aesa

  • @VishalSingh-er2bl
    @VishalSingh-er2bl 9 หลายเดือนก่อน

    just wow...

  • @advaitgraut
    @advaitgraut 4 หลายเดือนก่อน

    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

  • @prasadsontakke3905
    @prasadsontakke3905 7 หลายเดือนก่อน

    fs.writeFilesync("./test.txt", "Hello world")
    ^
    TypeError: fs.writeFilesync is not a function

  • @techiji1645
    @techiji1645 14 วันที่ผ่านมา

    anyone have node js handwritten notes

  • @genzsubh
    @genzsubh 5 หลายเดือนก่อน

    8:19 Galt bol diye h vo.. WriteFile sync nhi h vo.. Async hi hai hai na

  • @bunnytheweebster
    @bunnytheweebster 8 หลายเดือนก่อน

    vid-5 ✅

  • @amankumar3639
    @amankumar3639 5 หลายเดือนก่อน

    👍👍👍👍👍👍👍

  • @ShivendraPratap524
    @ShivendraPratap524 ปีที่แล้ว

    Sir new video kab tak upload karenge aap

  • @Adarsh_agrahari
    @Adarsh_agrahari 11 หลายเดือนก่อน

    👍👍

  • @deepakmaharana125
    @deepakmaharana125 5 หลายเดือนก่อน

    53 Comments
    53 Comments
    53 Comments
    53 Comments
    53 Comments

  • @prabhatdeshmukh9592
    @prabhatdeshmukh9592 9 หลายเดือนก่อน

    You're a really great teacher, I haven't seen such a detailed and clear explanation anywhere. Thanks a bunch!

  • @HEMANTKUMAR-wx6yv
    @HEMANTKUMAR-wx6yv 7 หลายเดือนก่อน

    amazing