8.5: Saving Data to JSON File with Node.js - Programming with Text

Поділитися
Вставка
  • Опубліковано 23 січ 2025

КОМЕНТАРІ • 137

  • @Doschia
    @Doschia 8 років тому +126

    I love the way how you're teaching everything, you're always excited, happy and you can clearly see that you like what you're doing!
    And eventhough you are talking very fast, l can understand every single word! Thanks for that, keep the great work up.

  • @scronkfinkle650
    @scronkfinkle650 8 років тому +20

    Hello Dan! I just want to say how greatly appreciative I am of all of this free and useful content that you're putting out. I am an aspiring developer who's signed up for virtually every eLearning site there is. They cover a lot of ground but you seem to be filling a void that's not common in these other generic sites. So I wish to thank you for filling that void.
    Keep up the tremendous work!

  • @jascha_huisman
    @jascha_huisman 4 роки тому

    I learnt so much more and faster watching your video's than reading all other documentation out there on the internet. Somehow, the things you say make a lot of more sense. Great explanation Daniel!

  • @quintilianodaletedeoliveir9656
    @quintilianodaletedeoliveir9656 4 роки тому

    Hey Dan I invested many hours trying to realize hot to save data on a json file.
    It`s incredible the way u teach this.
    Thanks a lot!

  • @JoshAharonoff
    @JoshAharonoff 7 років тому

    Incredible, 10/10. You have a real knack for teaching - us aspiring coders need more guys like you!

  • @kira-t
    @kira-t 3 роки тому

    Youre so excited, that makes it look and feel so much easier to start with it

  • @LeetCodeSimplified
    @LeetCodeSimplified 3 роки тому

    Wow, this is exactly what I was looking for! You're really a master at explaining things in a simple to understand way!

  • @kiciafu
    @kiciafu 5 років тому +9

    "Thank you for your word... but let's look at.. aa crashed.." this guy is brilliant ;)

  • @lifeofkiran6285
    @lifeofkiran6285 3 роки тому

    @1:30 i needed that dumb down explanation man thank you!!!!!!

  • @ACaruso
    @ACaruso 7 років тому

    This is awesome. Best online course in years.

  • @sIMP37
    @sIMP37 4 роки тому

    How do you save long text? like a long text from the user?

  • @iliketocode6986
    @iliketocode6986 4 роки тому

    nice explanation of sync/async and dint need hours to explain it you are a wizard.

  • @aetherwebdev3620
    @aetherwebdev3620 5 років тому +12

    1:12 Most Satisfying sound ever!!!

  • @nikamaisuradze8523
    @nikamaisuradze8523 4 роки тому +1

    6:33 😂😂never seen such vibes in any programming video, I love it

  • @FriendlyNeighborhoodPrgrammer
    @FriendlyNeighborhoodPrgrammer 2 роки тому

    I'll definitely reference this when I add permanent card saving to my discord bot! Thanks ive been looking for this for a while

  • @iamsachin619
    @iamsachin619 3 роки тому

    you are a blessing to humankind!

  • @ValchyGaming
    @ValchyGaming 6 років тому

    Why do I get "SyntaxError: Unexpected token ' in JSON at position 0" even though i used readFileSync?

  • @user-vd5im2mx5g
    @user-vd5im2mx5g 4 роки тому

    This is exactly what I have been looking for!

  • @sayonarabeats9048
    @sayonarabeats9048 5 років тому +1

    Figured I didnt even need this video...
    Watched it till the end, I was just entertained okay.

  • @Reility_
    @Reility_ 3 роки тому

    fs package is no longer available so what other package can we use?

  • @fash9340
    @fash9340 3 роки тому

    Instead of load balancing, I would like to save get data and store it as text. There are times that my server crashes and it is not able to show the coming data and then move it to the database. Do you think firebase would be a solution?!

  • @4ia06_ridhomuhammad6
    @4ia06_ridhomuhammad6 4 роки тому

    i m so glad find out your channel

  • @TheLEEMINJONG
    @TheLEEMINJONG 8 років тому +3

    This was exact tutorial that I was looking for! :) Thank you for walking us through for this awesome project!

  • @rajakota4544
    @rajakota4544 Рік тому

    What if json file has empty data and we need to read the data and add the data into it

  • @ddzeus9269
    @ddzeus9269 3 роки тому

    Incredible video even in 2021

  • @khalidhamza7651
    @khalidhamza7651 Рік тому

    error : always i find this error in console Uncaught ReferenceError: require is not defined : const fs = require('fs');
    any help

  • @CarelessMiss
    @CarelessMiss 6 років тому

    How do I make fs.writeFile add and not replace?

  • @vikasswamy3498
    @vikasswamy3498 3 роки тому

    Sir... I had a task to push ID's and ID values to geojson file.... And convert that geojson file to svg.. please give me a solution to achieve the task

  • @adron115
    @adron115 5 років тому

    Can you read the stored data you wrote a few seconds before without restarting the server before? That was just for showing, that the data isn´t gone after restarting, right?

  • @ffgcvs
    @ffgcvs 3 роки тому

    Very good explanation! Thank you!

  • @yuvrajagarkar8942
    @yuvrajagarkar8942 4 роки тому

    great teaching I really liked the way he teaches , great content

  • @ankitgupta9548
    @ankitgupta9548 5 років тому +1

    how to convert simple JavaScript file to node.js file?
    I want to know the conversion process?

  • @elhoussainbiri3089
    @elhoussainbiri3089 3 роки тому

    const fs = require('fs')
    Given me an error, how do I fix it?

  • @leontheonly101
    @leontheonly101 6 років тому

    how do you make the browser show JSON how how its usually written in a normal file and not like a simple string in one line?

    • @TheCodingTrain
      @TheCodingTrain  6 років тому

      I use a JSON formatter chrome extension.

    • @leontheonly101
      @leontheonly101 6 років тому

      @@TheCodingTrain Oh, ok cool :D, thank you!

  • @kisekinomahou
    @kisekinomahou 7 років тому

    Quality video, quality teacher. Thank you.

  • @cronosramm
    @cronosramm 5 років тому +1

    Excellent video bro!! thanks for that.. thanks!

  • @ok-alarm
    @ok-alarm 3 роки тому

    Great tutorial! thanks!
    What if I want to change the value of a key?
    how can I do that?

  • @さよこせつこ
    @さよこせつこ 3 роки тому

    Never understand node.js :/
    Does google chrome support node.js or ?
    Got a lot of error, one of them are --> require is not defined.
    Just trying to make a basic game with a score that I want to save to JSON, right now I'm using Microsoft Visual Studio and have HTML as a live server to google chrome.

  • @sanjays8687
    @sanjays8687 3 роки тому

    how to update the file when we have nested json object
    for Ex
    {
    "en-uk": {
    "browse_channel": "BROWSE CHANNELS",
    "channels": "channels",
    "video": "video",
    }
    }

  • @Hasan_Nawaz354
    @Hasan_Nawaz354 6 років тому +1

    can you make a video about to sending a file on client request to a server and then this text file should be stored on the server and on request text file should be transferred to client(in my case it is logi pi and i want to upload bit files in logi pi with Raspberry Pi ) please ?
    I will be very grateful to you.

  • @susulpone
    @susulpone 4 роки тому

    this is exactly what I needed!

  • @onilkabbo4073
    @onilkabbo4073 5 років тому

    Is it possible to make rest api using json???

  • @cpcorvers
    @cpcorvers 6 років тому +1

    Thanks for your great work!

  • @GuillermoBasombrio
    @GuillermoBasombrio 4 роки тому

    how to do this on angular 9/10? FS is deprecated?

  • @angshu7589
    @angshu7589 5 років тому

    Nice video, but is there a way to get the user input from a textarea or such?

  • @elfran_03
    @elfran_03 6 років тому +1

    Thanks for the explanation.

  • @EthanSteveOfficial
    @EthanSteveOfficial 7 років тому

    What about of typescript??I cant get the correct syntax with npm!

  • @Apfelwolken
    @Apfelwolken 4 роки тому

    I really like your tutorials, but what I do miss is a link in the description to the *previous* video in the series. _/off looking through his hundreds of videos for 8.4_

  • @olasoderlind5685
    @olasoderlind5685 8 років тому

    if i use php how do i send a post and revers whit $_POST[....];

  • @sinlg
    @sinlg 6 років тому

    if there are many people adding new words into the JSON file, and many concurrent write to file, will there be data overwritting issue?

    • @sinlg
      @sinlg 6 років тому

      i guess the API is only one listener.. if there were many (when you scale) then the data may be inconsistent across different instance of the listener

  • @2912kamil
    @2912kamil 7 років тому

    how to do it with input form instead req?

  • @oi_faen
    @oi_faen 8 років тому

    love your videos :)
    i want to see you play around with geojson-data :)
    maybe on a map (some gis-thinghy) like leaflet..

  • @yamelamadorfernandez7416
    @yamelamadorfernandez7416 5 років тому

    Your energy to teach is ten times greater than the energy Elon musk is using to power SpaceX rocket engines :D You rock man!

  • @hazamuna2611
    @hazamuna2611 6 років тому +1

    Thanks a lot for your work!

  • @halilnevzat
    @halilnevzat 2 роки тому

    i will remember you for the rest of my life

  • @harshitjoshi3082
    @harshitjoshi3082 6 років тому

    But why do you have to stringify the JSON data ?

  • @franckelisabeth5694
    @franckelisabeth5694 4 роки тому

    Hi thanks for the video, it's very interesting ! I have a question. Here you do that with node but how would you do to save a file on a server in a directory if you use your js in a website ? I think about send a request that contain my data but I don't know how and where to reach my data

  • @EternalLegionGaming
    @EternalLegionGaming 6 років тому

    Thanks! This is helpful. But how can I fetch data from an API and save it with this?

  • @phanta5m
    @phanta5m 4 роки тому

    Thank you, this is what i looking and wonder can i somehow save to portable format like JSON.

  • @love.ly.
    @love.ly. 5 років тому +1

    Very helpful!

  • @adamsh5391
    @adamsh5391 4 роки тому

    The best of the best thank you for this tutorial!!

  • @producertalk5337
    @producertalk5337 4 роки тому

    Hey thanks, filled some gaps in my understanding.

  • @BierGarten100
    @BierGarten100 6 років тому +1

    And how is the data change ? :D

  • @Gigatless
    @Gigatless 4 роки тому +1

    I love and hate this guy at the same time.

  • @SogMosee
    @SogMosee 7 років тому

    This was incredible.

  • @PetrosPollakis
    @PetrosPollakis 5 років тому

    Hello! Great tutorials but can you recommend any tutorial with the 4 choice where i can save data in data base?

  • @allisonfernandez2942
    @allisonfernandez2942 6 років тому +2

    You're awesome!

  • @priyathirunavukarasu1562
    @priyathirunavukarasu1562 5 років тому

    Hello Dan, Great work on the above. I just want to request your knowledge on something.
    I need to save a html table data in a file, where when the user clicks submit after entering the table data, the server has to create a file and store the table data in an excel format so that the user can view the data whenever he wants it, either online or he can download the file locally to his computer. I am learning node JS from your videos, and I would be excited if you could give some idea on how to approach this.

  • @maweryoutube9852
    @maweryoutube9852 6 років тому

    What is the name of the instructor, please. Full name

    • @keegan.j1321
      @keegan.j1321 6 років тому +1

      Go to his channel’s about page there’s links that you can find

    • @maweryoutube9852
      @maweryoutube9852 6 років тому

      @Bobby Tarantino So I could see if he has any courses on Udemy.com
      His way of explaining things is amazing.

  • @jooj_kk
    @jooj_kk 6 років тому

    script download link?

  • @dhirenpathak
    @dhirenpathak 6 років тому +1

    Superb

  • @hillaryjasel
    @hillaryjasel 5 років тому

    I cant use fs in react.
    I got an error no matter what :(

    • @Shadyholic
      @Shadyholic 5 років тому

      You can't use fs in react, you can use fs in node.

  • @Mouthwvsh
    @Mouthwvsh 6 років тому

    Great video!

  • @fastwayschool8340
    @fastwayschool8340 5 років тому

    On my pc is require not working

  • @christianejikeomeje3145
    @christianejikeomeje3145 5 років тому

    This amazing, you are a great teacher, what if i want to update a particular property, of the json file

  • @toshisharma603
    @toshisharma603 6 років тому

    thank you so much. it was really helpful.

  • @BUCKTHEWORD14
    @BUCKTHEWORD14 8 років тому

    Can you do a playlist on Node, Express and MongoDB please? Thanks.

  • @BananaTuTsWeb
    @BananaTuTsWeb 7 років тому

    Could you use a MySQL database?

  • @nicositepu3140
    @nicositepu3140 7 років тому

    great work bro.....can u make a video about "using method from dynamic link library (dll) from node", thank you

  • @theartofcoding6024
    @theartofcoding6024 4 роки тому

    you are awesome sir : )

  • @yoeriyoeri4264
    @yoeriyoeri4264 5 років тому +1

    The entire file overwrites itself, any ideas?

  • @neksodebe
    @neksodebe 4 роки тому

    You didn't need to use fs to read from the JSON file. You could just do it like this: "var words = require("words.json");"

  • @poopman8837
    @poopman8837 7 років тому +1

    you're amazing :D

  • @tusharmaurya1668
    @tusharmaurya1668 7 років тому +1

    Pls sir make video on NEDB on Electron.

  • @johnburney_hotdog9941
    @johnburney_hotdog9941 3 роки тому

    Thanks, man.

  • @kayderl
    @kayderl 4 роки тому

    Been looking for a tutorial on how to write my own JSON database. This is brilliant. Anybody know how I could integrate this method with GraphQL?

    • @happyfreeky
      @happyfreeky 4 роки тому

      Cadell Teng if you have a REST API, it can be wrapped in GraphQL

  • @DuskoPejacki
    @DuskoPejacki 6 років тому

    "Hey, wanna hear the most annoying sound in the world?"1:12 :D

  • @anujshaan1006
    @anujshaan1006 2 роки тому

    This guy looks like the professor (Money Heist) and even explain all details like him . How I was not here earlier?

  • @swatilekha_roy
    @swatilekha_roy 3 роки тому

    Thank you so very much

  • @marcofernandes7607
    @marcofernandes7607 8 років тому

    Amazing!!!

  • @IlhanNegis
    @IlhanNegis 8 років тому +23

    even on whiteboard, you should start your lists from 0!

    • @TheCodingTrain
      @TheCodingTrain  8 років тому +4

      +İlhan Neğiş haha good point!!

    • @MichielP1807
      @MichielP1807 8 років тому +4

      0! = 1 so he did it right

    • @mariothrowsfireballsuntitl1841
      @mariothrowsfireballsuntitl1841 7 років тому +1

      Every time I see a sentence end with a number and exclamation point I read it as factorial of that number.

    • @gregsoares6021
      @gregsoares6021 6 років тому

      lol, but is 0! = 1 ? proof ?

    • @uuu12343
      @uuu12343 6 років тому

      Greg Soares
      if
      5! = 5 x 4 x 3 x 2 x 1
      4! = 5! / 5
      3! = 4! / 4
      ....
      0! = 1! / 1 = 1
      Proof

  • @drkraw
    @drkraw 7 років тому

    When does he talk about NeDB ?

  • @HimFinancial
    @HimFinancial 6 років тому

    I like you, dude.

  • @ekser-thanksfor50ksubscrib72
    @ekser-thanksfor50ksubscrib72 5 років тому

    Text file as database? I see where Twitter got inspired.

  • @alexarsenev8805
    @alexarsenev8805 6 років тому

    you rock!

  • @manikantareddy2385
    @manikantareddy2385 5 років тому

    love it

  • @geelemo
    @geelemo 6 років тому

    you could just require the 'words' file or import for es6 syntax

  • @leevihalme4300
    @leevihalme4300 6 років тому

    late, but you could do "nodemon file.js -e .js" and it won't restart to .json file changes

  • @mohamedabdelmoneim5721
    @mohamedabdelmoneim5721 3 роки тому

    GREAT!!!!

  • @eugeniogonzato
    @eugeniogonzato 5 років тому

    Thank you!!!!!!