Understanding File System | Understanding Node.js Core Concepts FREE VERSION

Поделиться
HTML-код
  • Опубликовано: 7 фев 2025
  • Grab the complete and premium version of the course using this link:
    www.udemy.com/...
    This video is all about the Node.js File system, and by the end of it, you'll master the fs module!
    Final source code of the project: github.com/agi...
    Next Video: • Understanding Streams ...
    The Course - Free Version: • Understanding Node.js ...
    CORRECTION (December 29):
    I mentioned in the video that the double logs that we get might be something related to the visual studio code, but actually, it turns out it's something related to the fs.watch itself. Apparently, it's unstable and not consistent and sometimes reports events twice. I tried other packages out there but still the same thing. You can try the 'chokidar' package to not get the double logs, but it doesn't report all the events if they happen extremely fast, for example doing a thousand writes to a file. It's something more related to the operating system concepts, I try to dig deeper into this and share the results with you later!

Комментарии • 84

  • @VladislavSnegurov
    @VladislavSnegurov 2 года назад +39

    Please, don't stop. Your videos on node.js are the best on youtube. I really really like how you combine basics of computer science with learning node.js concepts. It really gives a deep understanding and allows to be not just a coder, but the programmer. Honestly, your computer science references is half a reason why i so like your videos

    • @Cododev
      @Cododev  2 года назад +4

      Thanks Vladyslav! Glad you found the course helpful so far and helped you learn more about computer science and programming!

  • @Cododev
    @Cododev  2 года назад +26

    CORRECTION (December 29, 2022):
    I mentioned in the video that the double logs that we get might be something related to the visual studio code, but actually, it turns out it's something related to the fs watch itself. Apparently, it's unstable and not consistent and sometimes reports events twice. I tried other packages out there but still the same thing. You can try the 'chokidar' package to not get the double logs, but it doesn't report all the events if they happen extremely fast, for example doing a thousand writes to a file. It's something more related to the operating system concepts, I try to dig deeper into this and share the results with you later!

    • @gouthamkrishna5490
      @gouthamkrishna5490 2 года назад

      You good at explaining when will be next Video

    • @Cododev
      @Cododev  2 года назад +1

      ​@@gouthamkrishna5490 Hi Goutham, thanks for your comment. The next video is pretty much complete and will be published within the next 24 hours!

    • @kivanc5789
      @kivanc5789 Год назад +1

      ​@@Cododev I assumed that it could be caused by "save on focus change" setting in vscode. Any updates?

    • @rayforever
      @rayforever 8 месяцев назад

      ​@@Cododev I think Indian made that package cuz chokidar means guard or boundry protector 😂😂😂

  • @sidben7048
    @sidben7048 2 года назад +25

    Wow you are back , your videos about event emitters and especially the buffers are amazing , thank you sir

  • @miggu
    @miggu Год назад +1

    I very much like that you go one or two levels below every explanation (but also know when not to digress) , in order to elucidate the description of a new concept

  • @randomcell708
    @randomcell708 2 года назад +3

    Gold dust content, please keep going , too many youtubers leave subscribers high and dry by not finishing these kind of long running series.

  • @WillFlores1
    @WillFlores1 Год назад +2

    I'm feeling confident after watching the first three, thanks for creating these lessons

  • @NoushadPatel-d8p
    @NoushadPatel-d8p Год назад +4

    This whole course on Nodejs is amazing.
    Please keep making such quality content man.

  • @pliniohavila
    @pliniohavila 2 года назад +1

    Very good. Very didactic, explains and writes very well.
    The good thing is that it not only presents the methods, but explains about them. Something that I almost don't see.
    Don't stop producing content.

  • @jimrox-i5v
    @jimrox-i5v Год назад +2

    I like your tutorials. They've opened my mind to many concepts in nodejs more than most other videos I've watched on RUclips.
    Keep up with the good work. Thanks

  • @mohitashliya8750
    @mohitashliya8750 2 года назад +2

    Expecting more videos from You Sir. The genuinity you provide is out of the world.

  • @whitebeardpirates7551
    @whitebeardpirates7551 2 года назад +1

    welcome backto uploading , i hope you'll upload more videos about Intermediate + Advanced nodejs. thanks I really really appreciate your effort ♥♥♥

  • @abdalahahmed4781
    @abdalahahmed4781 6 месяцев назад

    Don't stop bro, your tutorials are so good and powerful tutorials, you are the best explaining nodejs on youtube ❤❤

  • @abhineetsingh1291
    @abhineetsingh1291 Год назад +5

    0:00 quick summary
    9:30 what is a file
    16:30 How nodejs deals with files
    21:00 Promise Callback and synchronous Apis

  • @ryanwright3965
    @ryanwright3965 2 года назад +3

    I love your videos. You are so thorough with the background information. Keep up the good work.

  • @jsdepth
    @jsdepth 2 года назад +1

    Wow one More Nodejs core concept is now about to knock out.

  • @akshayshah7008
    @akshayshah7008 2 года назад +3

    Great lecture, give us some next topics which you are making video on, so that we can read the docs ourselves on that particular topic.

  • @leoxvic4701
    @leoxvic4701 8 месяцев назад

    Never stop making these gems! You are a gift to us

  • @alonsob4069
    @alonsob4069 2 года назад

    probably the best node course of all youtube

  • @cityrunner-x3x
    @cityrunner-x3x 2 года назад +1

    you are one of the best. pls come back with the amazing videos.

  • @MohamedAshraf-uc8zo
    @MohamedAshraf-uc8zo 2 года назад

    VERY HAPPY TO SEE AN NOTIFICATION FROM YOUR CHANNEL IN THIS PLAYLIST ,, KEEP IT UP

  • @CarlJdP
    @CarlJdP 8 месяцев назад

    45:00 Re: vscode double saves: it depends on your vscode autosave settings, e.g. my autosave is set to onTabFocuschange (or something like that) - it depends on ones personal preference, but i like that it autosaves when i for example switch focus to the terminal or anther tab, so that i dont get frustrating bugs of where there's one tab i forgot to save

  • @SimPwear84
    @SimPwear84 10 месяцев назад

    This is a Node JS Master Class - top quality content 🔥

  • @memduhcevik
    @memduhcevik Год назад

    Incredibly awesome tutorials. I wouldn't have such education there if I even participated in a bootcamp

  • @talkArt
    @talkArt Год назад

    Absolute goldmine, thanks for sharing this, i have been learning node js rushing into express only to be back here to basics but this series is all i need.
    Would love to know if you would do this with next or express, specially with what is going on behind it.

  • @xaapt
    @xaapt Год назад

    Wow! Method of teaching is the GOAT

  • @brahimtaifour6849
    @brahimtaifour6849 2 года назад +1

    hi there, I just watched your video and i want to thank you for your time and effort, you have a really nice way of explaining stuff and I hope that you will make more videos , my best wishes for you

  • @jackshephard7920
    @jackshephard7920 2 года назад +1

    Amazing one! Looking forward to stream topic!

  • @omidsoleimani3817
    @omidsoleimani3817 2 года назад

    OMG, I really learn from your videos, Looking forward to see streaming topic. Great Job.

  • @bicube7529
    @bicube7529 Год назад

    just finished also this video, awesome experience. really looking forward to the next 2

  • @ahsanamin3818
    @ahsanamin3818 Год назад

    Thank you so much brother. this playlist is really helpful for us. Please continue. upload more useful content.

  • @giotevdorashvili
    @giotevdorashvili 2 года назад

    I wish the video about Streams were already here, thanks.

  • @moelf325
    @moelf325 Год назад +1

    Great job! You're indeed amzing! Thank you su much !!!

  • @moneyharry
    @moneyharry Год назад

    Thank you very much for these wonderful lessons.

  • @hariprasath9985
    @hariprasath9985 2 года назад +1

    Finally you made it

  • @mohamedmirghani1747
    @mohamedmirghani1747 Год назад

    As usual amazing explanation, many thanks

  • @BeingNahid-oi7mm
    @BeingNahid-oi7mm 6 месяцев назад

    you are the best brother ever

  • @shujamigo
    @shujamigo 2 года назад +1

    brilliantly explained. thanks

  • @georgigeorgiev3765
    @georgigeorgiev3765 Год назад +1

    Cheers man! You are amazing!

  • @karlluthor6628
    @karlluthor6628 2 года назад

    U r the best 🎉
    Can’t wait to see the streams video

  • @dorelbarbu9453
    @dorelbarbu9453 Год назад +1

    Hello! At 01:03:10 I didn't get the exact reason why the returned buffer has 0s in it. I have the below snippet:
    const size = (await commandFileHandler.stat()).size;
    const content = await commandFileHandler.read(Buffer.alloc(size));
    Why is the position of the file modified here? Even if we don't specify offset and position it should in theory read from the beginning of the file.
    The below snippet behaves correctly, and reads from the beginning, so I don't understand why explicitly specifying the buffer in which we read makes it in such a way that we need to also specify the offset and position.
    const size = (await commandFileHandler.stat()).size;
    const content = await commandFileHandler.read();
    You explained in the video that it is because the position changed, but why did it change exactly? Is this some behavior that is documented and that I am missing?
    Would you be able to help me understand this, please?
    And as always, thank you for the very high-quality content!

  • @serjio8781
    @serjio8781 Год назад

    Love your videos man

  • @jshvaron
    @jshvaron Год назад

    Thanks so much, this helped me a ton! subbed.

  • @jritzeku
    @jritzeku Год назад

    This series is EXTREMELY helpful! Thank you for your contribution. I would also like to learn about linux in a little more in depth but as it pertains to software engineers. Any good resources??

  • @sagarghare9829
    @sagarghare9829 Год назад

    Completed. Thanks for tutotial :)

  • @Netpilation
    @Netpilation Год назад

    life changing videos

  • @hamidhamri5384
    @hamidhamri5384 Год назад

    high quality content

  • @new_avangard
    @new_avangard 2 года назад +1

    Thank you bro!

  • @Js-Lovers
    @Js-Lovers 2 года назад

    Need more concept of nodejs 💕💓

  • @LekkyDev
    @LekkyDev 10 месяцев назад

    @1:10 Property 'on' does not exist on commandFileHandler!
    How do you deal with that?

  • @mahdeearnob
    @mahdeearnob 16 дней назад

    what is the vs code theme you used ?

  • @yogeshkhatri4555
    @yogeshkhatri4555 Год назад

    great content!

  • @muhammed7457
    @muhammed7457 2 года назад

    Thank you man🖤

  • @rajkirankelangi5751
    @rajkirankelangi5751 2 года назад

    please make more videos in node series and express,mysql,mongodb ..please

  • @ujjawalkumar5707
    @ujjawalkumar5707 2 года назад

    The content is exceptional.
    I have one question: why you have attached event to commantFileHandler? we can make a function call instead. please someone explain the advantages of attaching event in this scenario.

    • @Cododev
      @Cododev  2 года назад

      Hi! Thanks for your question. Actually it’s just to make the code look a bit cleaner. We can also do it with a function call which is totally fine. And in my video Understanding Events, I explained that when we add an event listener and emit an event, we’re just calling a function and that’s it (please refer to that video if it doesn’t make sense). So in short, just for readability purposes!

  • @themouldyorange2912
    @themouldyorange2912 Год назад

    so this app will only create plain/text file types because you are using fs.open() method? if you want to create a python file type or any other type you would need to use another method, is that right? i was confused as to why the files created were not showing the correct type in explorer and that is the only answer i have been able to find.

  • @susanthawarnapura
    @susanthawarnapura 2 года назад +2

    waiting for node streams video

  • @dreamcoreamv7091
    @dreamcoreamv7091 Год назад +1

    The "3" triggered me

  • @codyshaner3258
    @codyshaner3258 Год назад

    Did they remove the watch method from 'fs/promises'
    I only see it in 'fs' but its not available from 'fs.promises'
    When I try and run the exercise from 41:20 - i get the error :
    TypeError: fs.watch is not a function
    If I change the import from 'fs/promises' to 'fs' and run it - i get the error :
    TypeError: watcher is not async iterable
    When I log the import for 'fs/promises' I don't even see '.watch' as a member.
    Am I missing a step or has this changed in the past year?

    • @Cododev
      @Cododev  Год назад +1

      Hmm I doubt that it’s changed Cody, what version of Node are you using?
      Also if you can show me your code I’d be able to see if you are missing something, thanks!

    • @codyshaner3258
      @codyshaner3258 Год назад

      @@Cododev Ahh good call, seems I was using node 14. I switched to 18 and it's good to go

  • @shahariarhriday8966
    @shahariarhriday8966 2 года назад

    Hello,
    I am not finding your nodejs streaming core video. Could you please share that one?

  • @gabrielmachado5391
    @gabrielmachado5391 2 года назад

    Thank you!

  • @indicgamer2907
    @indicgamer2907 Год назад

    1:05:27 im still getting some buffers of zero length pls help

  • @SHROUDICH
    @SHROUDICH Год назад

    Hello, you've mentioned that using synchronous fs method is not best way to do it because it freezes processes, doesn't Promise/await do the same thing, it also stops everything till it finishes.

    • @eyriusbacterius
      @eyriusbacterius Год назад

      as i understand it promises are handled asynchronously with async / await. it looks like synchronous code but it is asynchronous code. so no - it doesnt stop everything till it finishes

  • @stodani
    @stodani Год назад

    según me enseñaron siempre deberia evitar la alternativa sincrona (readFileSync) porque eso bloquearia y detendria el proceso principal (en caso de que mi app fuera mas larga y compleja) 🤔

  • @muhammedcansoy6131
    @muhammedcansoy6131 Год назад

    awesome

  • @jameshansen801
    @jameshansen801 Год назад

    When I use the createFile function, while it's returning the file, for some reason in VS Code it's appearing "empty" or as if it's not able to recognize its type; in a similar fashion as if you were to create an untitled file. When I go an attempt to rename that file, I always get the error that there's no file at that path to rename. I even tried playing around with the flags to see if anything changes, but to no avail. Do you have any idea what might be causing this? If it helps at all, I'm using Pop os.

    • @jameshansen801
      @jameshansen801 Год назад

      UPDATE: For the time being, I believe I solved the issue. Upon further investigation, I noticed that still for some reason, Node is adding a newline character at the end of the file path. I still can't figure that out but, for example if I use the trim function like this: createFile(filePath.trim()); it seems to alleviate the problem.

  • @muhammedcansoy1434
    @muhammedcansoy1434 Год назад

    Awesome

  • @danko5678
    @danko5678 Год назад

    To make the watch function work correctly, I used the function from cb API with debounce trick:
    let fsTimeout;
    watch("./command.txt", (event) => {
    if (!fsTimeout) {
    console.log(event);
    if (event === "change") {
    commandFileHandler.emit("change");
    }
    fsTimeout = setTimeout(() => {
    fsTimeout = null;
    }, 1000);
    }
    });
    Haha, event as a string, took 20 minutes to figure out what i was doing wrong. Actually I have a realy realy good question: why this code doesn't work correctly without "console.log(event);" ?

  • @carvingagiant
    @carvingagiant Год назад

    1:10:00

  • @aliadel1723
    @aliadel1723 2 года назад

    please do more videos

  • @SabarivasanSankar
    @SabarivasanSankar Год назад +1

    Run fast the cops are coming for you :)))

  • @rayforever
    @rayforever 8 месяцев назад

    39:04 this is why I hate JS

  • @abdullahsiam7609
    @abdullahsiam7609 Год назад

    just 3 min of video. I stopped and subscribe.

  • @igboanugwocollins4452
    @igboanugwocollins4452 Год назад

    Awesome awesome video, thank you so much! 👏

  • @abdulwadood-np4kb
    @abdulwadood-np4kb Год назад

    🔥@Codedev